<?php 
namespace Qwadmin\Controller;

class ShenpController extends ComController
{


	public function index()
	{

		$gid = M('auth_group_access')->where(['uid'=>$_SESSION['uid']])->select();
		// dump($gid);
		// exit;
		$glist = M('auth_group')->where(['id'=>$gid[0]['group_id']])->select();
		// $title = substr($glist[0]['title'], 0,2);
		// dump($glist);
		// exit;
		$ulist = M('member')->where(['uid'=>$_SESSION['uid']])->select();
// dump($ulist);
// 		exit;
		



		if ($glist[0]['title'] == '超级管理员') {
				$x_list = M('look')->where(['type'=>['in',array(0,2)]])->order('time desc')->limit(5)->select();
				$y_list = M('cost')->order('time desc')->limit(5)->select();
				$this->assign('x_list',$x_list);
				$this->assign('y_list',$y_list);
				$this->display();
				exit;
		}
		switch ($ulist[0]['m_type']) {
			case '2':   //主管
				$db = M("look");
				$apost = $glist[0]['post'];
				// $x_list = M('look')->where(['look'=>0,'ment'=>$apost,'ju'=>0,'type'=>0])->order('id DESC')->select();
				$count = $db->where(['look'=>0,'ment'=>$apost,'ju'=>0,'type'=>0])->count();
				// dump($count);
				// exit;
				$pagecount = 10;
				$page = new \Think\Page($count , $pagecount);
				// $row[] = '';
				$page->parameter = $row; //此处的row是数组，为了传递查询条件
				$page->setConfig('first');
				$page->setConfig('prev','上一页');
				$page->setConfig('next','下一页');
				$page->setConfig('last','尾页');
				$page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% 第 '.I('p',1).' 页/共 %TOTAL_PAGE% 页 ( '.$pagecount.' 条/页 共 %TOTAL_ROW% 条)');
				$show = $page->show();
				$list = $db->where(['look'=>0,'ment'=>$apost,'ju'=>0,'type'=>0])->order('ment desc')->limit($page->firstRow.','.$page->listRows)->select();
				$xnum = M('look')->where(['look'=>0,'ment'=>$apost,'ju'=>0,'type'=>0])->count();
				$gnum = M('look')->where(['look'=>0,'ment'=>$apost,'ju'=>0,'type'=>2])->count();
				$jnum = M('look')->where(['look'=>0,'ment'=>$apost,'ju'=>0,'type'=>1])->count();
				// $y_list = M('cost')->where(['look'=>0,'ment'=>$apost,'ju'=>0,])->order('id DESC')->limit(5)->select();
				$this->assign('x_list',$list);
				$this->assign('page',$show);
				$this->assign('xnum',$xnum);
				$this->assign('gnum',$gnum);
				$this->assign('jnum',$jnum);
				// $this->assign('y_list',$y_list);
				$this->display();
				break;
			case '3':  //经理
				// dump($glist);
				// 		exit;
				switch ($glist[0]['post']) {
					case '行政中心':
						$apost = $glist[0]['post'];
						$apost = $glist[0]['post'];
						$x_list = M('look')->where(['look'=>8,'ju'=>0,'type'=> 0,'ment'=>$apost])->order('id DESC')->limit(5)->select();
						$xnum = M('look')->where(['look'=>8,'ment'=>$apost,'ju'=>0,'type'=>0])->count();
						$gnum = M('look')->where(['look'=>8,'ment'=>$apost,'ju'=>0,'type'=>2])->count();
						$jnum = M('look')->where(['look'=>8,'ment'=>$apost,'ju'=>0,'type'=>1])->count();
						// $y_list = M('cost')->where(['look'=>0,'ment'=>$apost,'ju'=>0,])->order('id DESC')->limit(5)->select();
						
						$this->assign('xnum',$xnum);
						$this->assign('gnum',$gnum);
						$this->assign('jnum',$jnum);
						$this->assign('x_list',$x_list);
						$this->assign('type',$type);
						$this->assign('y_list',$y_list);
						$this->display();
						break;
					case '采购中心':
						$apost = $glist[0]['post'];
						$x_list = M('look')->where(['look'=>9,'ment'=>$apost,'ju'=>0,'type'=>0])->order('id DESC')->limit(5)->select();
						$xnum = M('look')->where(['look'=>9,'ment'=>$apost,'ju'=>0,'type'=>0])->count();
						$gnum = M('look')->where(['look'=>9,'ment'=>$apost,'ju'=>0,'type'=>2])->count();
						$jnum = M('look')->where(['look'=>9,'ment'=>$apost,'ju'=>0,'type'=>1])->count();
						// $y_list = M('cost')->where(['look'=>0,'ment'=>$apost,'ju'=>0,])->order('id DESC')->limit(5)->select();
						
						$this->assign('xnum',$xnum);
						$this->assign('gnum',$gnum);
						$this->assign('jnum',$jnum);
						// $y_list = M('cost')->where(['look'=>9,'ju'=>0])->order('id DESC')->limit(5)->select();
						$this->assign('x_list',$x_list);
						$this->assign('y_list',$y_list);
						$this->display();
						break;
					case '财务中心':
						$apost = $glist[0]['post'];
						$x_list = M('look')->where(['look'=>10,'ment'=>$apost,'ju'=>0,'type'=>0])->order('id DESC')->limit(5)->select();
						$xnum = M('look')->where(['look'=>10,'ment'=>$apost,'ju'=>0,'type'=>0])->count();
						$gnum = M('look')->where(['look'=>10,'ment'=>$apost,'ju'=>0,'type'=>2])->count();
						$jnum = M('look')->where(['look'=>10,'ment'=>$apost,'ju'=>0,'type'=>1])->count();
						// $y_list = M('cost')->where(['look'=>0,'ment'=>$apost,'ju'=>0,])->order('id DESC')->limit(5)->select();
						
						$this->assign('xnum',$xnum);
						$this->assign('gnum',$gnum);
						$this->assign('jnum',$jnum);
						// $y_list = M('cost')->where(['look'=>10,'ju'=>0])->order('id DESC')->limit(5)->select();
						$this->assign('x_list',$x_list);
						$this->assign('y_list',$y_list);
						$this->display();
						break;
					
					
				}
				break;
			
			case '8':  //总经理(网)
				// $apost = $glist[0]['post'];
				$mlist = M('auth_group')->where(['mtype'=>1])->select();

				foreach ($mlist as $vn) {
				// echo $v['n_id'];
				// exit;
				// $ment .= "`ment`="."'".$vn['title']."'"." or ";
				// $ment .= "'".$vn['title']."'"." , ";
				$ments[] =  $vn['post'];
					// 

				}
				 $where = [
            		'ment' => [
                		'in',
                		$ments
            		],
            		'look' => 1,
            		'type'=>0,
            		'ju'   => 0

        		];

    //     			dump($where);
				// exit;
				// $ments = $ment."`look`= 1"." "."or"." "."`ju`= 0";
				
				
				// $ment = "(".rtrim($ment,'or ').")"."AND"."("."`look`= 1"." "."AND"." "."`ju`= 0".")";
				
				// $ment =rtrim($ment,', ');
				// echo $ment;
				// exit;
				$x_list =  M('look')->where($where)->order('id DESC')->limit(5)->select();
				$xnum = M('look')->where(['look'=>1,'ment'=>['in',$ments],'ju'=>0,'type'=>0])->count();
				$gnum = M('look')->where(['look'=>1,'ment'=>['in',$ments],'ju'=>0,'type'=>2])->count();
				$jnum = M('look')->where(['look'=>1,'ment'=>['in',$ments],'ju'=>0,'type'=>1])->count();
						// $y_list = M('cost')->where(['look'=>0,'ment'=>$apost,'ju'=>0,])->order('id DESC')->limit(5)->select();
						
				$this->assign('xnum',$xnum);
				$this->assign('gnum',$gnum);
				$this->assign('jnum',$jnum);
				// $x_list = "SELECT * FROM oa_look where ment in($ment) AND (`look`= 1 AND `ju`=0)";
				// dump($x_list);
				// exit;
				// $y_list = M('cost')->where(['look'=>1,'ju'=>0,'ment'=>$ment])->order('id DESC')->limit(5)->select();
				$type = 'wang';
				$this->assign('type',$type);
				$this->assign('x_list',$x_list);
				$this->assign('y_list',$y_list);
				$this->display();
				break;
			case '9':  //总经理(职)
				// $apost = $glist[0]['post'];
				$mlist = M('auth_group')->where(['mtype'=>2])->select();
				// dump($mlist);
				// exit;
				foreach ($mlist as $vn) {
				// echo $v['n_id'];
				// exit;
				// $ment .= "`ment`="."'".$vn['title']."'"." or ";
				// $ment .= "'".$vn['title']."'"." , ";
					$ments[] =  $vn['post'];
					// 

				}
				 $where = [
            		'ment' => [
                		'in',
                		$ments
            		],
            		'look' => 1,
            		'type'=>  0,
            		'ju'   => 0

        		];

    //     			dump($where);
				// exit;
				// $ments = $ment."`look`= 1"." "."or"." "."`ju`= 0";
				
				
				// $ment = "(".rtrim($ment,'or ').")"."AND"."("."`look`= 1"." "."AND"." "."`ju`= 0".")";
				
				// $ment =rtrim($ment,', ');
				// echo $ment;
				// exit;
				// $x_list =  M('look')->where($where)->order('id DESC')->select();
				$db = M("look");
				$count = $db->where($where)->count();
				$pagecount = 10;
				$page = new \Think\Page($count , $pagecount);
				// $row[] = '';
				$page->parameter = $row; //此处的row是数组，为了传递查询条件
				$page->setConfig('first');
				$page->setConfig('prev','上一页');
				$page->setConfig('next','下一页');
				$page->setConfig('last','尾页');
				$page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% 第 '.I('p',1).' 页/共 %TOTAL_PAGE% 页 ( '.$pagecount.' 条/页 共 %TOTAL_ROW% 条)');
				$show = $page->show();
				$list = $db->where($where)->order('id desc')->limit($page->firstRow.','.$page->listRows)->select();
				$xnum = M('look')->where(['look'=>1,'ment'=>['in',$ments],'ju'=>0,'type'=>0])->count();
				$gnum = M('look')->where(['look'=>1,'ment'=>['in',$ments],'ju'=>0,'type'=>2])->count();
				$jnum = M('look')->where(['look'=>1,'ment'=>['in',$ments],'ju'=>0,'type'=>1])->count();
						// $y_list = M('cost')->where(['look'=>0,'ment'=>$apost,'ju'=>0,])->order('id DESC')->limit(5)->select();
						
				$this->assign('xnum',$xnum);
				$this->assign('gnum',$gnum);
				$this->assign('jnum',$jnum);
				// $x_list = "SELECT * FROM oa_look where ment in($ment) AND (`look`= 1 AND `ju`=0)";
				// dump($x_list);
				// exit;
				// $y_list = M('cost')->where(['look'=>1,'ju'=>0,'ment'=>$ment])->order('id DESC')->limit(5)->select();
				$type = 'zhi';
				$this->assign('type',$type);
				$this->assign('x_list',$list);
				$this->assign('page',$show);
				// $this->assign('y_list',$y_list);
				$this->display();
				break;
			


			
		}

		// if ($ulist[0]['m_type'] <= 3 && $glist[0]['title'] != '超级管理员') {
		// 	// 行政物资审核
		// 	$apost = $glist[0]['post'];
		// 	// echo $apost;
		// 	// exit;
		// 	// if ($apost == 0) {
		// 	// 	$apost = $glist[0]['title'];
		// 	// }else{
		// 	// 	$bran = $glist[0]['post'];
		// 	// }
		// 	// echo $bran;
		// 	// exit;
		// 	$x_list = M('look')->where(['look'=>0,'ment'=>$apost])->order('time desc')->limit(5)->select();
		// 	// $j_list = M('look')->where(['type'=>1,'look'=>0,'ment'=>$apost])->limit(5)->select();
		// 	// $g_list = M('look')->where(['type'=>2,'look'=>0,'ment'=>$apost])->limit(5)->select();
		// 	//费用审核
		// 	$y_list = M('cost')->where(['look'=>0,'ment'=>$apost])->limit(5)->select();
		// 	// $yy_list = M('cost')->where(['type'=>2,'look'=>0,'ment'=>$apost])->limit(5)->select();
		// 	// $xj_list = M('cost')->where(['type'=>3,'look'=>0,'ment'=>$apost])->limit(5)->select();
		// 	// $h_list = M('cost')->where(['type'=>4,'look'=>0,'ment'=>$apost])->limit(5)->select();

		// 	// 		dump($x_list);
		// 	// exit;
			

		// 	$this->assign('x_list',$x_list);
		// 	// $this->assign('tt',$tt);
		// 	// $this->assign('j_list',$j_list);
		// 	// $this->assign('g_list',$g_list);
		// 	$this->assign('y_list',$y_list);
		// 	// $this->assign('yy_list',$yy_list);
		// 	// $this->assign('xj_list',$xj_list);
		// 	// $this->assign('h_list',$h_list);
		// 	$this->display();
		// 	exit;
		// }else{
		// 	// 行政物资审核
		// 	$x_list = M('look')->where(['look'=>0])->limit(5)->select();
		// 	// $j_list = M('look')->where(['type'=>1,'look'=>0])->limit(5)->select();
		// 	// $g_list = M('look')->where(['type'=>2,'look'=>0])->limit(5)->select();
		// 	//费用审核
		// 	$y_list = M('cost')->where(['look'=>0])->order('time desc')->limit(5)->select();
		// 	// $yy_list = M('cost')->where(['type'=>2,'look'=>0])->limit(5)->select();
		// 	// $xj_list = M('cost')->where(['type'=>3,'look'=>0])->limit(5)->select();
		// 	// $h_list = M('cost')->where(['type'=>4,'look'=>0])->limit(5)->select();

		// 	// 		dump($x_list);
		// 	// exit;
		// 	$this->assign('x_list',$x_list);
		// 	// $this->assign('j_list',$j_list);
		// 	// $this->assign('g_list',$g_list);
		// 	$this->assign('y_list',$y_list);
		// 	// $this->assign('yy_list',$yy_list);
		// 	// $this->assign('xj_list',$xj_list);
		// 	// $this->assign('h_list',$h_list);
		// 	$this->display();
		// }

		
	}




	public function xindex()
	{
		
		$type = $_GET['type'];
		$gid = M('auth_group_access')->where(['uid'=>$_SESSION['uid']])->select();
		
		$glist = M('auth_group')->where(['id'=>$gid[0]['group_id']])->select();
		
		$ulist = M('member')->where(['uid'=>$_SESSION['uid']])->select();
		$apost = $glist[0]['post'];
		
		switch ($type) {
			case '1': //固定资产购置审批

				switch ($ulist[0]['m_type']) {
					case '2':   //主管
							$db = M("look");
					        // $where = "a_id=".$uid;
					        $count = $db->where(['type'=>2,'look'=>0,'ment'=>$apost,'ju'=>0])->count();
					        $pagecount = 9;
					        $page = new \Think\Page($count , $pagecount);
					        // $row[] = '';
					        $page->parameter = $row; //此处的row是数组，为了传递查询条件
					        $page->setConfig('first');
					        $page->setConfig('prev','上一页');
					        $page->setConfig('next','下一页');
					        $page->setConfig('last','尾页');
					        $page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% 第 '.I('p',1).' 页/共 %TOTAL_PAGE% 页 ( '.$pagecount.' 条/页 共 %TOTAL_ROW% 条)');
					        $show = $page->show();
					        $list = $db->where(['type'=>2,'look'=>0,'ment'=>$apost,'ju'=>0])->order('id desc')->limit($page->firstRow.','.$page->listRows)->select();
					        $title = '部门固定资产购置审批';
					        $xnum = M('look')->where(['look'=>0,'ment'=>$apost,'ju'=>0,'type'=>0])->count();
							$gnum = M('look')->where(['look'=>0,'ment'=>$apost,'ju'=>0,'type'=>2])->count();
							$jnum = M('look')->where(['look'=>0,'ment'=>$apost,'ju'=>0,'type'=>1])->count();
							// $y_list = M('cost')->where(['look'=>0,'ment'=>$apost,'ju'=>0,])->order('id DESC')->limit(5)->select();
							
							$this->assign('xnum',$xnum);
							$this->assign('gnum',$gnum);
							$this->assign('jnum',$jnum);
					        $this->assign('list',$list);
					        $this->assign('page',$show);
					        $this->assign('title',$title);
							$this->display('Shenp/xindex');
						break;
					case '3':  //经理/总监
							switch ($glist[0]['post']) {
								case '行政中心':
									$apost = $glist[0]['post'];
									// $x_list = M('look')->where(['look'=>8,'ju'=>0,'type'=>2])->order('id DESC')->select();
									// $y_list = M('cost')->where(['look'=>8,'ju'=>0])->order('id DESC')->select();
									$db = M("look");
									$type = 'xing';
									$title = '部门固定资产购置审批';
									$count = $db->where(['look'=>8,'ju'=>0,'type'=>2])->count();
							        $pagecount = 10;
							        $page = new \Think\Page($count , $pagecount);
							        // $row[] = '';
							        $page->parameter = $row; //此处的row是数组，为了传递查询条件
							        $page->setConfig('first');
							        $page->setConfig('prev','上一页');
							        $page->setConfig('next','下一页');
							        $page->setConfig('last','尾页');
							        $page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% 第 '.I('p',1).' 页/共 %TOTAL_PAGE% 页 ( '.$pagecount.' 条/页 共 %TOTAL_ROW% 条)');
							        $show = $page->show();
							        $list = $db->where(['look'=>8,'ju'=>0,'type'=>2])->order('id desc')->limit($page->firstRow.','.$page->listRows)->select();
							        $xnum = M('look')->where(['look'=>8,'ment'=>$apost,'ju'=>0,'type'=>0])->count();
									$gnum = M('look')->where(['look'=>8,'ment'=>$apost,'ju'=>0,'type'=>2])->count();
									$jnum = M('look')->where(['look'=>8,'ment'=>$apost,'ju'=>0,'type'=>1])->count();
									// $y_list = M('cost')->where(['look'=>0,'ment'=>$apost,'ju'=>0,])->order('id DESC')->limit(5)->select();
									
									$this->assign('xnum',$xnum);
									$this->assign('gnum',$gnum);
									$this->assign('jnum',$jnum);
									$this->assign('page',$show);
									$this->assign('title',$title);
									$this->assign('list',$list);
									$this->assign('type',$type);
									// $this->assign('y_list',$y_list);
									$this->display();
									break;
								case '采购中心':
									$apost = $glist[0]['post'];
									// $x_list = M('look')->where(['look'=>9,'ment'=>$apost,'ju'=>0,'type'=>2])->order('id DESC')->select();
									// $y_list = M('cost')->where(['look'=>9,'ju'=>0])->order('id DESC')->select();
									$db = M("look");
									$count = $db->where(['look'=>9,'ment'=>$apost,'ju'=>0,'type'=>2])->count();
							        $pagecount = 10;
							        $page = new \Think\Page($count , $pagecount);
							        // $row[] = '';
							        $page->parameter = $row; //此处的row是数组，为了传递查询条件
							        $page->setConfig('first');
							        $page->setConfig('prev','上一页');
							        $page->setConfig('next','下一页');
							        $page->setConfig('last','尾页');
							        $page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% 第 '.I('p',1).' 页/共 %TOTAL_PAGE% 页 ( '.$pagecount.' 条/页 共 %TOTAL_ROW% 条)');
							        $show = $page->show();
							        $list = $db->where(['look'=>9,'ment'=>$apost,'ju'=>0,'type'=>2])->order('id desc')->limit($page->firstRow.','.$page->listRows)->select();
									$this->assign('page',$show);
									$title = '部门固定资产购置审批';
									$xnum = M('look')->where(['look'=>9,'ment'=>$apost,'ju'=>0,'type'=>0])->count();
									$gnum = M('look')->where(['look'=>9,'ment'=>$apost,'ju'=>0,'type'=>2])->count();
									$jnum = M('look')->where(['look'=>9,'ment'=>$apost,'ju'=>0,'type'=>1])->count();
									// $y_list = M('cost')->where(['look'=>0,'ment'=>$apost,'ju'=>0,])->order('id DESC')->limit(5)->select();
									
									$this->assign('xnum',$xnum);
									$this->assign('gnum',$gnum);
									$this->assign('jnum',$jnum);
									$this->assign('title',$title);
									$this->assign('list',$list);
									// $this->assign('y_list',$y_list);
									$this->display();
									break;
								case '财务中心':
									$apost = $glist[0]['post'];
									// $x_list = M('look')->where(['look'=>10,'ment'=>$apost,'ju'=>0,'type'=>2])->order('id DESC')->limit(5)->select();
									// $y_list = M('cost')->where(['look'=>10,'ju'=>0])->order('id DESC')->limit(5)->select();
									$db = M("look");
									$count = $db->where(['look'=>10,'ment'=>$apost,'ju'=>0,'type'=>2])->count();
							        $pagecount = 9;
							        $page = new \Think\Page($count , $pagecount);
							        // $row[] = '';
							        $page->parameter = $row; //此处的row是数组，为了传递查询条件
							        $page->setConfig('first');
							        $page->setConfig('prev','上一页');
							        $page->setConfig('next','下一页');
							        $page->setConfig('last','尾页');
							        $page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% 第 '.I('p',1).' 页/共 %TOTAL_PAGE% 页 ( '.$pagecount.' 条/页 共 %TOTAL_ROW% 条)');
							        $show = $page->show();
							        $list = $db->where(['look'=>10,'ment'=>$apost,'ju'=>0,'type'=>2])->order('id desc')->limit($page->firstRow.','.$page->listRows)->select();
							        $xnum = M('look')->where(['look'=>10,'ment'=>$apost,'ju'=>0,'type'=>0])->count();
									$gnum = M('look')->where(['look'=>10,'ment'=>$apost,'ju'=>0,'type'=>2])->count();
									$jnum = M('look')->where(['look'=>10,'ment'=>$apost,'ju'=>0,'type'=>1])->count();
									// $y_list = M('cost')->where(['look'=>0,'ment'=>$apost,'ju'=>0,])->order('id DESC')->limit(5)->select();
									
									$this->assign('xnum',$xnum);
									$this->assign('gnum',$gnum);
									$this->assign('jnum',$jnum);
									$this->assign('page',$show);
									$title = '部门固定资产购置审批';
									$this->assign('title',$title);
									$this->assign('list',$list);
									// $this->assign('y_list',$y_list);
									$this->display();
									break;
								
								
							}		
						break;
					
					

					case '8':  //总经理(网)
							// $apost = $glist[0]['post'];
							$mlist = M('auth_group')->where(['mtype'=>1])->select();

							foreach ($mlist as $vn) {
							// echo $v['n_id'];
							// exit;
							// $ment .= "`ment`="."'".$vn['title']."'"." or ";
							// $ment .= "'".$vn['title']."'"." , ";
								$ments[] =  $vn['title'];
								// 

							}
							 $where = [
			            		'ment' => [
			                		'in',
			                		$ments
			            		],
			            		'look' => 1,
			            		'type'=> 2,
			            		'ju'   => 0

			        		];

			    //     			dump($where);
							// exit;
							// $ments = $ment."`look`= 1"." "."or"." "."`ju`= 0";
							
							
							// $ment = "(".rtrim($ment,'or ').")"."AND"."("."`look`= 1"." "."AND"." "."`ju`= 0".")";
							
							// $ment =rtrim($ment,', ');
							// echo $ment;
							// exit;
							// $x_list =  M('look')->where($where)->order('id DESC')->limit(5)->select();
							// $x_list = "SELECT * FROM oa_look where ment in($ment) AND (`look`= 1 AND `ju`=0)";
							// dump($x_list);
							// exit;
							// $y_list = M('cost')->where(['type'=>2,'look'=>1,'ju'=>0,'ment'=>$ment])->order('id DESC')->limit(5)->select();
									$db = M("look");
									$count = $db->where($where)->count();
							        $pagecount = 9;
							        $page = new \Think\Page($count , $pagecount);
							        // $row[] = '';
							        $page->parameter = $row; //此处的row是数组，为了传递查询条件
							        $page->setConfig('first');
							        $page->setConfig('prev','上一页');
							        $page->setConfig('next','下一页');
							        $page->setConfig('last','尾页');
							        $page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% 第 '.I('p',1).' 页/共 %TOTAL_PAGE% 页 ( '.$pagecount.' 条/页 共 %TOTAL_ROW% 条)');
							        $show = $page->show();
							        $list = $db->where($where)->order('id desc')->limit($page->firstRow.','.$page->listRows)->select();
									$this->assign('page',$show);
									$title = '部门固定资产购置审批';
							$xnum = M('look')->where(['look'=>1,'ment'=>['in',$ments],'ju'=>0,'type'=>0])->count();
							$gnum = M('look')->where(['look'=>1,'ment'=>['in',$ments],'ju'=>0,'type'=>2])->count();
							$jnum = M('look')->where(['look'=>1,'ment'=>['in',$ments],'ju'=>0,'type'=>1])->count();
									// $y_list = M('cost')->where(['look'=>0,'ment'=>$apost,'ju'=>0,])->order('id DESC')->limit(5)->select();
									
							$this->assign('xnum',$xnum);
							$this->assign('gnum',$gnum);
							$this->assign('jnum',$jnum);
							$this->assign('title',$title);
							$this->assign('x_list',$list);
							// $this->assign('y_list',$y_list);
							$this->display();
							break;
					case '9':  //总经理(职)
							// $apost = $glist[0]['post'];
							$mlist = M('auth_group')->where(['mtype'=>2])->select();
							// dump($mlist);
							// exit;
							foreach ($mlist as $vn) {
							// echo $v['n_id'];
							// exit;
							// $ment .= "`ment`="."'".$vn['title']."'"." or ";
							// $ment .= "'".$vn['title']."'"." , ";
								$ments[] =  $vn['title'];
								// 

							}
							 $where = [
			            		'ment' => [
			                		'in',
			                		$ments
			            		],
			            		'look' => 1,
			            		'type'=> 2,
			            		'ju'   => 0

			        		];

			    
									$db = M("look");
									$count = $db->where($where)->count();
									// dump($count);
									// exit;
							        $pagecount = 9;
							        $page = new \Think\Page($count , $pagecount);
							        // $row[] = '';
							        $page->parameter = $row; //此处的row是数组，为了传递查询条件
							        $page->setConfig('first');
							        $page->setConfig('prev','上一页');
							        $page->setConfig('next','下一页');
							        $page->setConfig('last','尾页');
							        $page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% 第 '.I('p',1).' 页/共 %TOTAL_PAGE% 页 ( '.$pagecount.' 条/页 共 %TOTAL_ROW% 条)');
							        $show = $page->show();
							        $list = $db->where($where)->order('id desc')->limit($page->firstRow.','.$page->listRows)->select();
							$xnum = M('look')->where(['look'=>1,'ment'=>['in',$ments],'ju'=>0,'type'=>0])->count();
							$gnum = M('look')->where(['look'=>1,'ment'=>['in',$ments],'ju'=>0,'type'=>2])->count();
							$jnum = M('look')->where(['look'=>1,'ment'=>['in',$ments],'ju'=>0,'type'=>1])->count();
									// $y_list = M('cost')->where(['look'=>0,'ment'=>$apost,'ju'=>0,])->order('id DESC')->limit(5)->select();
									
							$this->assign('xnum',$xnum);
							$this->assign('gnum',$gnum);
							$this->assign('jnum',$jnum);
							$title = '部门固定资产购置审批';
							$this->assign('title',$title);
							$this->assign('list',$list);
							$this->assign('page',$show);
							// $this->assign('y_list',$y_list);
							$this->display();
						break;



					


					
				}
				
					
				break;




			case '2': //行政物资审批
				switch ($ulist[0]['m_type']) {
					case '2':   //主管
							$db = M("look");
					        // $where = "a_id=".$uid;
					        $count = $db->where(['type'=>0,'look'=>0,'ment'=>$apost,'ju'=>0])->count();
					        $pagecount = 9;
					        $page = new \Think\Page($count , $pagecount);
					        // $row[] = '';
					        $page->parameter = $row; //此处的row是数组，为了传递查询条件
					        $page->setConfig('first');
					        $page->setConfig('prev','上一页');
					        $page->setConfig('next','下一页');
					        $page->setConfig('last','尾页');
					        $page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% 第 '.I('p',1).' 页/共 %TOTAL_PAGE% 页 ( '.$pagecount.' 条/页 共 %TOTAL_ROW% 条)');
					        $show = $page->show();
					        $list = $db->where(['type'=>0,'look'=>0,'ment'=>$apost,'ju'=>0])->order('id desc')->limit($page->firstRow.','.$page->listRows)->select();
					        $title = '部门行政物资审批';
					        $xnum = M('look')->where(['look'=>0,'ment'=>$apost,'ju'=>0,'type'=>0])->count();
							$gnum = M('look')->where(['look'=>0,'ment'=>$apost,'ju'=>0,'type'=>2])->count();
							$jnum = M('look')->where(['look'=>0,'ment'=>$apost,'ju'=>0,'type'=>1])->count();
									// $y_list = M('cost')->where(['look'=>0,'ment'=>$apost,'ju'=>0,])->order('id DESC')->limit(5)->select();
									
							$this->assign('xnum',$xnum);
							$this->assign('gnum',$gnum);
							$this->assign('jnum',$jnum);
					        $this->assign('list',$list);
					        $this->assign('page',$show);
					        $this->assign('title',$title);
							$this->display('Shenp/xindex');
						break;
					case '3':  //经理/总监
							switch ($glist[0]['post']) {
								case '行政中心':
									$apost = $glist[0]['post'];
									// $x_list = M('look')->where(['look'=>8,'ju'=>0,'type'=>0])->order('id DESC')->limit(5)->select();
									// $y_list = M('cost')->where(['look'=>8,'ju'=>0])->order('id DESC')->limit(5)->select();
									$db = M("look");
							        // $where = "a_id=".$uid;
							        $count = $db->where(['look'=>8,'ju'=>0,'type'=>0])->count();
							        $pagecount = 9;
							        $page = new \Think\Page($count , $pagecount);
							        // $row[] = '';
							        $page->parameter = $row; //此处的row是数组，为了传递查询条件
							        $page->setConfig('first');
							        $page->setConfig('prev','上一页');
							        $page->setConfig('next','下一页');
							        $page->setConfig('last','尾页');
							        $page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% 第 '.I('p',1).' 页/共 %TOTAL_PAGE% 页 ( '.$pagecount.' 条/页 共 %TOTAL_ROW% 条)');
							        $show = $page->show();
							        $list = $db->where(['look'=>8,'ju'=>0,'type'=>0])->order('id desc')->limit($page->firstRow.','.$page->listRows)->select();
									$type = 'xing';
									$title = '部门行政物资审批';
									$xnum = M('look')->where(['look'=>8,'ment'=>$apost,'ju'=>0,'type'=>0])->count();
									$gnum = M('look')->where(['look'=>8,'ment'=>$apost,'ju'=>0,'type'=>2])->count();
									$jnum = M('look')->where(['look'=>8,'ment'=>$apost,'ju'=>0,'type'=>1])->count();
									// $y_list = M('cost')->where(['look'=>0,'ment'=>$apost,'ju'=>0,])->order('id DESC')->limit(5)->select();
									
									$this->assign('xnum',$xnum);
									$this->assign('gnum',$gnum);
									$this->assign('jnum',$jnum);
									$this->assign('title',$title);
									$this->assign('list',$list);
									$this->assign('type',$type);
									$this->assign('page',$show);
									// $this->assign('y_list',$y_list);
									$this->display();
									break;
								case '采购中心':
									$apost = $glist[0]['post'];
									// $x_list = M('look')->where(['look'=>9,'ment'=>$apost,'ju'=>0,'type'=>0])->order('id DESC')->limit(5)->select();
									// $y_list = M('cost')->where(['look'=>9,'ju'=>0])->order('id DESC')->limit(5)->select();
									// 
									$db = M("look");
							        // $where = "a_id=".$uid;
							        $count = $db->where(['look'=>9,'ment'=>$apost,'ju'=>0,'type'=>0])->count();
							        $pagecount = 9;
							        $page = new \Think\Page($count , $pagecount);
							        // $row[] = '';
							        $page->parameter = $row; //此处的row是数组，为了传递查询条件
							        $page->setConfig('first');
							        $page->setConfig('prev','上一页');
							        $page->setConfig('next','下一页');
							        $page->setConfig('last','尾页');
							        $page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% 第 '.I('p',1).' 页/共 %TOTAL_PAGE% 页 ( '.$pagecount.' 条/页 共 %TOTAL_ROW% 条)');
							        $show = $page->show();
							        $list = $db->where(['look'=>9,'ment'=>$apost,'ju'=>0,'type'=>0])->order('id desc')->limit($page->firstRow.','.$page->listRows)->select();
							        $xnum = M('look')->where(['look'=>9,'ment'=>$apost,'ju'=>0,'type'=>0])->count();
									$gnum = M('look')->where(['look'=>9,'ment'=>$apost,'ju'=>0,'type'=>2])->count();
									$jnum = M('look')->where(['look'=>9,'ment'=>$apost,'ju'=>0,'type'=>1])->count();
									// $y_list = M('cost')->where(['look'=>0,'ment'=>$apost,'ju'=>0,])->order('id DESC')->limit(5)->select();
									
									$this->assign('xnum',$xnum);
									$this->assign('gnum',$gnum);
									$this->assign('jnum',$jnum);
									$title = '部门行政物资审批';
									$this->assign('title',$title);
									$this->assign('list',$list);
									$this->assign('page',$show);
									// $this->assign('y_list',$y_list);
									$this->display();
									break;
								case '财务中心':
									$apost = $glist[0]['post'];
									// $x_list = M('look')->where(['look'=>10,'ment'=>$apost,'ju'=>0,'type'=>0])->order('id DESC')->limit(5)->select();
									// $y_list = M('cost')->where(['look'=>10,'ju'=>0])->order('id DESC')->limit(5)->select();
									$db = M("look");
							        // $where = "a_id=".$uid;
							        $count = $db->where(['look'=>10,'ment'=>$apost,'ju'=>0,'type'=>0])->count();
							        $pagecount = 9;
							        $page = new \Think\Page($count , $pagecount);
							        // $row[] = '';
							        $page->parameter = $row; //此处的row是数组，为了传递查询条件
							        $page->setConfig('first');
							        $page->setConfig('prev','上一页');
							        $page->setConfig('next','下一页');
							        $page->setConfig('last','尾页');
							        $page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% 第 '.I('p',1).' 页/共 %TOTAL_PAGE% 页 ( '.$pagecount.' 条/页 共 %TOTAL_ROW% 条)');
							        $show = $page->show();
							        $list = $db->where(['look'=>10,'ment'=>$apost,'ju'=>0,'type'=>0])->order('id desc')->limit($page->firstRow.','.$page->listRows)->select();
									$title = '部门行政物资审批';
									$xnum = M('look')->where(['look'=>10,'ment'=>$apost,'ju'=>0,'type'=>0])->count();
									$gnum = M('look')->where(['look'=>10,'ment'=>$apost,'ju'=>0,'type'=>2])->count();
									$jnum = M('look')->where(['look'=>10,'ment'=>$apost,'ju'=>0,'type'=>1])->count();
									// $y_list = M('cost')->where(['look'=>0,'ment'=>$apost,'ju'=>0,])->order('id DESC')->limit(5)->select();
									
									$this->assign('xnum',$xnum);
									$this->assign('gnum',$gnum);
									$this->assign('jnum',$jnum);
									$this->assign('title',$title);
									$this->assign('list',$x_list);
									$this->assign('page',$show);
									// $this->assign('y_list',$y_list);
									$this->display();
									break;
								
								
							}
						break;
					
					case '8':  //总经理(网)
							// $apost = $glist[0]['post'];
							$mlist = M('auth_group')->where(['mtype'=>1])->select();

							foreach ($mlist as $vn) {
							// echo $v['n_id'];
							// exit;
							// $ment .= "`ment`="."'".$vn['title']."'"." or ";
							// $ment .= "'".$vn['title']."'"." , ";
								$ments[] =  $vn['title'];
								// 

							}
							 $where = [
			            		'ment' => [
			                		'in',
			                		$ments
			            		],
			            		'look' => 1,
			            		'type'=>0,
			            		'ju'   => 0

			        		];

			   
							$db = M("look");
							        // $where = "a_id=".$uid;
							$count = $db->where($where)->count();
							$pagecount = 9;
							$page = new \Think\Page($count , $pagecount);
							        // $row[] = '';
							$page->parameter = $row; //此处的row是数组，为了传递查询条件
							$page->setConfig('first');
							$page->setConfig('prev','上一页');
							$page->setConfig('next','下一页');
							$page->setConfig('last','尾页');
							$page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% 第 '.I('p',1).' 页/共 %TOTAL_PAGE% 页 ( '.$pagecount.' 条/页 共 %TOTAL_ROW% 条)');
							$show = $page->show();
							$list = $db->where($where)->order('id desc')->limit($page->firstRow.','.$page->listRows)->select();
							// $x_list = "SELECT * FROM oa_look where ment in($ment) AND (`look`= 1 AND `ju`=0)";
							// dump($x_list);
							// exit;
							// $y_list = M('cost')->where(['type'=>0,'look'=>1,'ju'=>0,'ment'=>$ment])->order('id DESC')->limit(5)->select();
							$title = '部门行政物资审批';
							$xnum = M('look')->where(['look'=>1,'ment'=>['in',$ments],'ju'=>0,'type'=>0])->count();
							$gnum = M('look')->where(['look'=>1,'ment'=>['in',$ments],'ju'=>0,'type'=>2])->count();
							$jnum = M('look')->where(['look'=>1,'ment'=>['in',$ments],'ju'=>0,'type'=>1])->count();
									// $y_list = M('cost')->where(['look'=>0,'ment'=>$apost,'ju'=>0,])->order('id DESC')->limit(5)->select();
									
							$this->assign('xnum',$xnum);
							$this->assign('gnum',$gnum);
							$this->assign('jnum',$jnum);
							$this->assign('title',$title);
							$this->assign('list',$list);
							$this->assign('page',$show);
							// $this->assign('y_list',$y_list);
							$this->display();
							break;
					case '9':  //总经理(职)
							// $apost = $glist[0]['post'];
							$mlist = M('auth_group')->where(['mtype'=>2])->select();
							// dump($mlist);
							// exit;
							foreach ($mlist as $vn) {
							// echo $v['n_id'];
							// exit;
							// $ment .= "`ment`="."'".$vn['title']."'"." or ";
							// $ment .= "'".$vn['title']."'"." , ";
								$ments[] =  $vn['title'];
								// 

							}
							 $where = [
			            		'ment' => [
			                		'in',
			                		$ments
			            		],
			            		'look' => 1,
			            		'type'=>  0,
			            		'ju'   => 0

			        		];

							$db = M("look");
							        // $where = "a_id=".$uid;
							$count = $db->where($where)->count();
							// dump($count);
							// exit;
							$pagecount = 9;
							$page = new \Think\Page($count , $pagecount);
							        // $row[] = '';
							$page->parameter = $row; //此处的row是数组，为了传递查询条件
							$page->setConfig('first');
							$page->setConfig('prev','上一页');
							$page->setConfig('next','下一页');
							$page->setConfig('last','尾页');
							$page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% 第 '.I('p',1).' 页/共 %TOTAL_PAGE% 页 ( '.$pagecount.' 条/页 共 %TOTAL_ROW% 条)');
							$show = $page->show();
							$list = $db->where($where)->order('id desc')->limit($page->firstRow.','.$page->listRows)->select();
							
							$title = '部门行政物资审批';
							$xnum = M('look')->where(['look'=>1,'ment'=>['in',$ments],'ju'=>0,'type'=>0])->count();
							$gnum = M('look')->where(['look'=>1,'ment'=>['in',$ments],'ju'=>0,'type'=>2])->count();
							$jnum = M('look')->where(['look'=>1,'ment'=>['in',$ments],'ju'=>0,'type'=>1])->count();
									// $y_list = M('cost')->where(['look'=>0,'ment'=>$apost,'ju'=>0,])->order('id DESC')->limit(5)->select();
									
							$this->assign('xnum',$xnum);
							$this->assign('gnum',$gnum);
							$this->assign('jnum',$jnum);
							$this->assign('title',$title);
							$this->assign('list',$list);
							$this->assign('page',$show);
							// $this->assign('y_list',$y_list);
							$this->display();
						break;
					


					
				}
				

				break;



			case '3':  //急性行政物资审批
				switch ($ulist[0]['m_type']) {
					case '2':   //主管
							$db = M("look");
					        // $where = "a_id=".$uid;
					        $count = $db->where(['type'=>1,'look'=>0,'ment'=>$apost,'ju'=>0])->count();
					        $pagecount = 9;
					        $page = new \Think\Page($count , $pagecount);
					        // $row[] = '';
					        $page->parameter = $row; //此处的row是数组，为了传递查询条件
					        $page->setConfig('first');
					        $page->setConfig('prev','上一页');
					        $page->setConfig('next','下一页');
					        $page->setConfig('last','尾页');
					        $page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% 第 '.I('p',1).' 页/共 %TOTAL_PAGE% 页 ( '.$pagecount.' 条/页 共 %TOTAL_ROW% 条)');
					        $show = $page->show();
					        $list = $db->where(['type'=>1,'look'=>0,'ment'=>$apost,'ju'=>0])->order('id desc')->limit($page->firstRow.','.$page->listRows)->select();
					        $title = '部门急性行政物资审批';
					        $xnum = M('look')->where(['look'=>0,'ment'=>$apost,'ju'=>0,'type'=>0])->count();
							$gnum = M('look')->where(['look'=>0,'ment'=>$apost,'ju'=>0,'type'=>2])->count();
							$jnum = M('look')->where(['look'=>0,'ment'=>$apost,'ju'=>0,'type'=>1])->count();
									// $y_list = M('cost')->where(['look'=>0,'ment'=>$apost,'ju'=>0,])->order('id DESC')->limit(5)->select();
									
							$this->assign('xnum',$xnum);
							$this->assign('gnum',$gnum);
							$this->assign('jnum',$jnum);
					        $this->assign('list',$list);
					        $this->assign('page',$show);
					        $this->assign('title',$title);
							$this->display('Shenp/xindex');
						break;
					case '3':  //经理/总监
							switch ($glist[0]['post']) {
								case '行政中心':
									$apost = $glist[0]['post'];
									// $x_list = M('look')->where(['look'=>8,'ju'=>0,'type'=>1])->order('id DESC')->limit(5)->select();
									// $y_list = M('cost')->where(['look'=>8,'ju'=>0])->order('id DESC')->limit(5)->select();
									$db = M("look");
							        // $where = "a_id=".$uid;
							        $count = $db->where(['look'=>8,'ju'=>0,'type'=>1])->count();
							        $pagecount = 9;
							        $page = new \Think\Page($count , $pagecount);
							        // $row[] = '';
							        $page->parameter = $row; //此处的row是数组，为了传递查询条件
							        $page->setConfig('first');
							        $page->setConfig('prev','上一页');
							        $page->setConfig('next','下一页');
							        $page->setConfig('last','尾页');
							        $page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% 第 '.I('p',1).' 页/共 %TOTAL_PAGE% 页 ( '.$pagecount.' 条/页 共 %TOTAL_ROW% 条)');
							        $show = $page->show();
							        $list = $db->where(['look'=>8,'ju'=>0,'type'=>1])->order('id desc')->limit($page->firstRow.','.$page->listRows)->select();
									$this->assign('page',$show);
									$type = 'xing';
									$title = '部门急性行政物资审批';
									$xnum = M('look')->where(['look'=>8,'ment'=>$apost,'ju'=>0,'type'=>0])->count();
									$gnum = M('look')->where(['look'=>8,'ment'=>$apost,'ju'=>0,'type'=>2])->count();
									$jnum = M('look')->where(['look'=>8,'ment'=>$apost,'ju'=>0,'type'=>1])->count();
									// $y_list = M('cost')->where(['look'=>0,'ment'=>$apost,'ju'=>0,])->order('id DESC')->limit(5)->select();
									
									$this->assign('xnum',$xnum);
									$this->assign('gnum',$gnum);
									$this->assign('jnum',$jnum);
									$this->assign('title',$title);
									$this->assign('list',$list);
									$this->assign('type',$type);
									// $this->assign('y_list',$y_list);
									$this->display();
									break;
								case '采购中心':
									$apost = $glist[0]['post'];
									// $x_list = M('look')->where(['look'=>9,'ment'=>$apost,'ju'=>0,'type'=>1])->order('id DESC')->limit(5)->select();
									// $y_list = M('cost')->where(['look'=>9,'ju'=>0])->order('id DESC')->limit(5)->select();
									// 
									$db = M("look");
							        // $where = "a_id=".$uid;
							        $count = $db->where(['look'=>9,'ment'=>$apost,'ju'=>0,'type'=>1])->count();
							        $pagecount = 9;
							        $page = new \Think\Page($count , $pagecount);
							        // $row[] = '';
							        $page->parameter = $row; //此处的row是数组，为了传递查询条件
							        $page->setConfig('first');
							        $page->setConfig('prev','上一页');
							        $page->setConfig('next','下一页');
							        $page->setConfig('last','尾页');
							        $page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% 第 '.I('p',1).' 页/共 %TOTAL_PAGE% 页 ( '.$pagecount.' 条/页 共 %TOTAL_ROW% 条)');
							        $show = $page->show();
							        $list = $db->where(['look'=>9,'ment'=>$apost,'ju'=>0,'type'=>1])->order('id desc')->limit($page->firstRow.','.$page->listRows)->select();
									$this->assign('page',$show);
									$title = '部门急性行政物资审批';
									$xnum = M('look')->where(['look'=>9,'ment'=>$apost,'ju'=>0,'type'=>0])->count();
									$gnum = M('look')->where(['look'=>9,'ment'=>$apost,'ju'=>0,'type'=>2])->count();
									$jnum = M('look')->where(['look'=>9,'ment'=>$apost,'ju'=>0,'type'=>1])->count();
									// $y_list = M('cost')->where(['look'=>0,'ment'=>$apost,'ju'=>0,])->order('id DESC')->limit(5)->select();
									
									$this->assign('xnum',$xnum);
									$this->assign('gnum',$gnum);
									$this->assign('jnum',$jnum);
									$this->assign('title',$title);
									$this->assign('list',$x_list);
									// $this->assign('y_list',$y_list);
									$this->display();
									break;
								case '财务中心':
									$apost = $glist[0]['post'];
									// $x_list = M('look')->where(['look'=>10,'ment'=>$apost,'ju'=>0,'type'=>1])->order('id DESC')->limit(5)->select();
									$db = M("look");
							        // $where = "a_id=".$uid;
							        $count = $db->where(['look'=>10,'ment'=>$apost,'ju'=>0,'type'=>1])->count();
							        $pagecount = 9;
							        $page = new \Think\Page($count , $pagecount);
							        // $row[] = '';
							        $page->parameter = $row; //此处的row是数组，为了传递查询条件
							        $page->setConfig('first');
							        $page->setConfig('prev','上一页');
							        $page->setConfig('next','下一页');
							        $page->setConfig('last','尾页');
							        $page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% 第 '.I('p',1).' 页/共 %TOTAL_PAGE% 页 ( '.$pagecount.' 条/页 共 %TOTAL_ROW% 条)');
							        $show = $page->show();
							        $list = $db->where(['look'=>10,'ment'=>$apost,'ju'=>0,'type'=>1])->order('id desc')->limit($page->firstRow.','.$page->listRows)->select();
									$this->assign('page',$show);
									$title = '部门急性行政物资审批';
									$xnum = M('look')->where(['look'=>10,'ment'=>$apost,'ju'=>0,'type'=>0])->count();
									$gnum = M('look')->where(['look'=>10,'ment'=>$apost,'ju'=>0,'type'=>2])->count();
									$jnum = M('look')->where(['look'=>10,'ment'=>$apost,'ju'=>0,'type'=>1])->count();
									// $y_list = M('cost')->where(['look'=>0,'ment'=>$apost,'ju'=>0,])->order('id DESC')->limit(5)->select();
									
									$this->assign('xnum',$xnum);
									$this->assign('gnum',$gnum);
									$this->assign('jnum',$jnum);
									$this->assign('title',$title);
									$this->assign('list',$x_list);
									// $this->assign('y_list',$y_list);
									$this->display();
									break;
								
								
							}
						break;
				
					case '8':  //总经理(网)
							// $apost = $glist[0]['post'];
							$mlist = M('auth_group')->where(['mtype'=>1])->select();

							foreach ($mlist as $vn) {
							// echo $v['n_id'];
							// exit;
							// $ment .= "`ment`="."'".$vn['title']."'"." or ";
							// $ment .= "'".$vn['title']."'"." , ";
								$ments[] =  $vn['title'];
								// 

							}
							 $where = [
			            		'ment' => [
			                		'in',
			                		$ments
			            		],
			            		'look' => 1,
			            		'type'=>1,
			            		'ju'   => 0

			        		];

			    //     			dump($where);
							// exit;
							// $ments = $ment."`look`= 1"." "."or"." "."`ju`= 0";
							
							
							// $ment = "(".rtrim($ment,'or ').")"."AND"."("."`look`= 1"." "."AND"." "."`ju`= 0".")";
							
							// $ment =rtrim($ment,', ');
							// echo $ment;
							// exit;
							// $x_list =  M('look')->where($where)->order('ment DESC')->limit(5)->select();
							$db = M("look");
							// $where = "a_id=".$uid;
							$count = $db->where($where)->count();
							// dump($count);
							// exit;
							$pagecount = 9;
							$page = new \Think\Page($count , $pagecount);
							// $row[] = '';
							$page->parameter = $row; //此处的row是数组，为了传递查询条件
							$page->setConfig('first');
							$page->setConfig('prev','上一页');
							$page->setConfig('next','下一页');
							$page->setConfig('last','尾页');
							$page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% 第 '.I('p',1).' 页/共 %TOTAL_PAGE% 页 ( '.$pagecount.' 条/页 共 %TOTAL_ROW% 条)');
							$show = $page->show();
							$list = $db->where($where)->order('id desc')->limit($page->firstRow.','.$page->listRows)->select();
							$this->assign('page',$show);
							// $x_list = "SELECT * FROM oa_look where ment in($ment) AND (`look`= 1 AND `ju`=0)";
							// dump($x_list);
							// exit;
							// $y_list = M('cost')->where(['type'=>1,'look'=>1,'ju'=>0,'ment'=>$ment])->order('id DESC')->limit(5)->select();
							$title = '部门急性行政物资审批';
							$xnum = M('look')->where(['look'=>1,'ment'=>['in',$ments],'ju'=>0,'type'=>0])->count();
							$gnum = M('look')->where(['look'=>1,'ment'=>['in',$ments],'ju'=>0,'type'=>2])->count();
							$jnum = M('look')->where(['look'=>1,'ment'=>['in',$ments],'ju'=>0,'type'=>1])->count();
									// $y_list = M('cost')->where(['look'=>0,'ment'=>$apost,'ju'=>0,])->order('id DESC')->limit(5)->select();
									
							$this->assign('xnum',$xnum);
							$this->assign('gnum',$gnum);
							$this->assign('jnum',$jnum);
							$this->assign('title',$title);
							$this->assign('list',$list);
							// $this->assign('y_list',$y_list);
							$this->display();
							break;
					case '9':  //总经理(职)
							// $apost = $glist[0]['post'];
							$mlist = M('auth_group')->where(['mtype'=>2])->select();
							// dump($mlist);
							// exit;
							foreach ($mlist as $vn) {
							// echo $v['n_id'];
							// exit;
							// $ment .= "`ment`="."'".$vn['title']."'"." or ";
							// $ment .= "'".$vn['title']."'"." , ";
								$ments[] =  $vn['title'];
								// 

							}
							 $where = [
			            		'ment' => [
			                		'in',
			                		$ments
			            		],
			            		'look' => 1,
			            		'type'=>1,
			            		'ju'   => 0

			        		];

			    //     			dump($where);
							// exit;
							// $ments = $ment."`look`= 1"." "."or"." "."`ju`= 0";
							
							
							// $ment = "(".rtrim($ment,'or ').")"."AND"."("."`look`= 1"." "."AND"." "."`ju`= 0".")";
							
							// $ment =rtrim($ment,', ');
							// echo $ment;
							// exit;
							// $x_list =  M('look')->where($where)->order('ment DESC')->limit(5)->select();
							$db = M("look");
							// $where = "a_id=".$uid;
							$count = $db->where($where)->count();
							$pagecount = 9;
							$page = new \Think\Page($count , $pagecount);
							// $row[] = '';
							$page->parameter = $row; //此处的row是数组，为了传递查询条件
							$page->setConfig('first');
							$page->setConfig('prev','上一页');
							$page->setConfig('next','下一页');
							$page->setConfig('last','尾页');
							$page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% 第 '.I('p',1).' 页/共 %TOTAL_PAGE% 页 ( '.$pagecount.' 条/页 共 %TOTAL_ROW% 条)');
							$show = $page->show();
							$list = $db->where($where)->order('id desc')->limit($page->firstRow.','.$page->listRows)->select();
							$this->assign('page',$show);
							// $x_list = "SELECT * FROM oa_look where ment in($ment) AND (`look`= 1 AND `ju`=0)";
							// dump($x_list);
							// exit;
							// $y_list = M('cost')->where(['type'=>1,'look'=>1,'ju'=>0,'ment'=>$ment])->order('id DESC')->limit(5)->select();
							$this->assign('list',$list);
							// $this->assign('y_list',$y_list);
							$title = '部门急性行政物资审批';
							$xnum = M('look')->where(['look'=>1,'ment'=>['in',$ments],'ju'=>0,'type'=>0])->count();
							$gnum = M('look')->where(['look'=>1,'ment'=>['in',$ments],'ju'=>0,'type'=>2])->count();
							$jnum = M('look')->where(['look'=>1,'ment'=>['in',$ments],'ju'=>0,'type'=>1])->count();
									// $y_list = M('cost')->where(['look'=>0,'ment'=>$apost,'ju'=>0,])->order('id DESC')->limit(5)->select();
									
							$this->assign('xnum',$xnum);
							$this->assign('gnum',$gnum);
							$this->assign('jnum',$jnum);
							$this->assign('title',$title);
							$this->display();
						break;
				


				break;
			
			// $this->display();
		}
	}

}





	//费用申请 -----------------------------------------------------------------
	public function findex()
	{
		// dump($_GET);
		$type = $_GET['type'];
		$gid = M('auth_group_access')->where(['uid'=>$_SESSION['uid']])->select();
		// dump($gid);
		// exit;
		$glist = M('auth_group')->where(['id'=>$gid[0]['group_id']])->select();
		// dump($type);
		// exit;
		$ulist = M('member')->where(['uid'=>$_SESSION['uid']])->select();
		$apost = $glist[0]['post'];
			// echo $apost;
			// exit;
			// if ($apost == 0) {
			// 	$bran = $glist[0]['title'];
			// }else{
			// 	$bran = $glist[0]['post'];
			// }
		switch ($type) {
			case '1': //业务招待费审批
				switch ($ulist[0]['m_type']) {
					case '2':   //主管
							$db = M("cost");
					        // $where = "a_id=".$uid;
					        $count = $db->where(['type'=>1,'look'=>0,'ment'=>$apost])->count();
					        $pagecount = 10;
					        $page = new \Think\Page($count , $pagecount);
					        // $row[] = '';
					        $page->parameter = $row; //此处的row是数组，为了传递查询条件
					        $page->setConfig('first');
					        $page->setConfig('prev','上一页');
					        $page->setConfig('next','下一页');
					        $page->setConfig('last','尾页');
					        $page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% 第 '.I('p',1).' 页/共 %TOTAL_PAGE% 页 ( '.$pagecount.' 条/页 共 %TOTAL_ROW% 条)');
					        $show = $page->show();
					        $list = $db->where(['type'=>1,'look'=>0,'ment'=>$apost])->order('time desc')->limit($page->firstRow.','.$page->listRows)->select();
					        $title = '业务招待费审批';
					        $this->assign('list',$list);
					        $this->assign('page',$show);
					        $this->assign('title',$title);
							$this->display('Shenp/findex');
						break;
					case '3':  //经理/总监
						$db = M("cost");
					        // $where = "a_id=".$uid;
					        $count = $db->where(['type'=>1,'look'=>1,'ment'=>$apost])->count();
					        $pagecount = 10;
					        $page = new \Think\Page($count , $pagecount);
					        // $row[] = '';
					        $page->parameter = $row; //此处的row是数组，为了传递查询条件
					        $page->setConfig('first');
					        $page->setConfig('prev','上一页');
					        $page->setConfig('next','下一页');
					        $page->setConfig('last','尾页');
					        $page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% 第 '.I('p',1).' 页/共 %TOTAL_PAGE% 页 ( '.$pagecount.' 条/页 共 %TOTAL_ROW% 条)');
					        $show = $page->show();
					        $list = $db->where(['type'=>1,'look'=>1,'ment'=>$apost])->order('time desc')->limit($page->firstRow.','.$page->listRows)->select();
					        $title = '业务招待费审批';
					        $this->assign('list',$list);
					        $this->assign('page',$show);
					        $this->assign('title',$title);
							$this->display('Shenp/findex');
						break;
					case '4':  //行政
							$db = M("cost");
					        // $where = "a_id=".$uid;
					        $count = $db->where(['type'=>1,'look'=>2])->count();
					        $pagecount = 10;
					        $page = new \Think\Page($count , $pagecount);
					        // $row[] = '';
					        $page->parameter = $row; //此处的row是数组，为了传递查询条件
					        $page->setConfig('first');
					        $page->setConfig('prev','上一页');
					        $page->setConfig('next','下一页');
					        $page->setConfig('last','尾页');
					        $page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% 第 '.I('p',1).' 页/共 %TOTAL_PAGE% 页 ( '.$pagecount.' 条/页 共 %TOTAL_ROW% 条)');
					        $show = $page->show();
					        $list = $db->where(['type'=>1,'look'=>2])->order('time desc')->limit($page->firstRow.','.$page->listRows)->select();
					        $title = '业务招待费审批';
					        $this->assign('list',$list);
					        $this->assign('page',$show);
					        $this->assign('title',$title);
							$this->display('Shenp/findex');
						break;
					case '5':  //财务
							$db = M("cost");
					        // $where = "a_id=".$uid;
					        $count = $db->where(['type'=>1,'look'=>3])->count();
					        $pagecount = 10;
					        $page = new \Think\Page($count , $pagecount);
					        // $row[] = '';
					        $page->parameter = $row; //此处的row是数组，为了传递查询条件
					        $page->setConfig('first');
					        $page->setConfig('prev','上一页');
					        $page->setConfig('next','下一页');
					        $page->setConfig('last','尾页');
					        $page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% 第 '.I('p',1).' 页/共 %TOTAL_PAGE% 页 ( '.$pagecount.' 条/页 共 %TOTAL_ROW% 条)');
					        $show = $page->show();
					        $list = $db->where(['type'=>1,'look'=>3])->order('time desc')->limit($page->firstRow.','.$page->listRows)->select();
					        $title = '业务招待费审批';
					        $this->assign('list',$list);
					        $this->assign('page',$show);
					        $this->assign('title',$title);
							$this->display('Shenp/findex');
						break;
					case '6':  //董事办
							$db = M("cost");
					        // $where = "a_id=".$uid;
					        $count = $db->where(['type'=>1,'look'=>4])->count();
					        $pagecount = 10;
					        $page = new \Think\Page($count , $pagecount);
					        // $row[] = '';
					        $page->parameter = $row; //此处的row是数组，为了传递查询条件
					        $page->setConfig('first');
					        $page->setConfig('prev','上一页');
					        $page->setConfig('next','下一页');
					        $page->setConfig('last','尾页');
					        $page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% 第 '.I('p',1).' 页/共 %TOTAL_PAGE% 页 ( '.$pagecount.' 条/页 共 %TOTAL_ROW% 条)');
					        $show = $page->show();
					        $list = $db->where(['type'=>1,'look'=>4])->order('time desc')->limit($page->firstRow.','.$page->listRows)->select();
					        $title = '业务招待费审批';
					        $this->assign('list',$list);
					        $this->assign('page',$show);
					        $this->assign('title',$title);
							$this->display('Shenp/findex');
						break;
					
					case '8':  //总经理(网)
							// $apost = $glist[0]['post'];
							$mlist = M('auth_group')->where(['mtype'=>1])->select();

							foreach ($mlist as $vn) {
							// echo $v['n_id'];
							// exit;
							// $ment .= "`ment`="."'".$vn['title']."'"." or ";
							// $ment .= "'".$vn['title']."'"." , ";
								$ments[] =  $vn['title'];
								// 

							}
							 $where = [
			            		'ment' => [
			                		'in',
			                		$ments
			            		],
			            		'look' => 1,
			            		'type'=>1,
			            		'ju'   => 0

			        		];

			    //     			dump($where);
							// exit;
							// $ments = $ment."`look`= 1"." "."or"." "."`ju`= 0";
							
							
							// $ment = "(".rtrim($ment,'or ').")"."AND"."("."`look`= 1"." "."AND"." "."`ju`= 0".")";
							
							// $ment =rtrim($ment,', ');
							// echo $ment;
							// exit;
							$y_list =  M('cost')->where($where)->order('ment DESC')->limit(5)->select();
							// $x_list = "SELECT * FROM oa_look where ment in($ment) AND (`look`= 1 AND `ju`=0)";
							// dump($x_list);
							// exit;
							// $y_list = M('cost')->where(['type'=>1,'look'=>1,'ju'=>0,'ment'=>$ment])->order('id DESC')->limit(5)->select();
							// $this->assign('x_list',$x_list);
							$this->assign('y_list',$y_list);
							$this->display();
							break;
					case '9':  //总经理(职)
							// $apost = $glist[0]['post'];
							$mlist = M('auth_group')->where(['mtype'=>2])->select();
							// dump($mlist);
							// exit;
							foreach ($mlist as $vn) {
							// echo $v['n_id'];
							// exit;
							// $ment .= "`ment`="."'".$vn['title']."'"." or ";
							// $ment .= "'".$vn['title']."'"." , ";
								$ments[] =  $vn['title'];
								// 

							}
							 $where = [
			            		'ment' => [
			                		'in',
			                		$ments
			            		],
			            		'look' => 1,
			            		'type'=>1,
			            		'ju'   => 0

			        		];

			    //     			dump($where);
							// exit;
							// $ments = $ment."`look`= 1"." "."or"." "."`ju`= 0";
							
							
							// $ment = "(".rtrim($ment,'or ').")"."AND"."("."`look`= 1"." "."AND"." "."`ju`= 0".")";
							
							// $ment =rtrim($ment,', ');
							// echo $ment;
							// exit;
							$y_list =  M('cost')->where($where)->order('ment DESC')->limit(5)->select();
							// $x_list = "SELECT * FROM oa_look where ment in($ment) AND (`look`= 1 AND `ju`=0)";
							// dump($x_list);
							// exit;
							// $y_list = M('cost')->where(['type'=>1,'look'=>1,'ju'=>0,'ment'=>$ment])->order('id DESC')->limit(5)->select();
							// $this->assign('x_list',$x_list);
							$this->assign('y_list',$y_list);
							$this->display();
						break;

					
				}
				
				


					
				break;




			case '2':  //药品耗材审批
				switch ($ulist[0]['m_type']) {
					case '2':   //主管
							$db = M("cost");
					        // $where = "a_id=".$uid;
					        $count = $db->where(['type'=>2,'look'=>0,'ment'=>$apost])->count();
					        $pagecount = 10;
					        $page = new \Think\Page($count , $pagecount);
					        // $row[] = '';
					        $page->parameter = $row; //此处的row是数组，为了传递查询条件
					        $page->setConfig('first');
					        $page->setConfig('prev','上一页');
					        $page->setConfig('next','下一页');
					        $page->setConfig('last','尾页');
					        $page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% 第 '.I('p',1).' 页/共 %TOTAL_PAGE% 页 ( '.$pagecount.' 条/页 共 %TOTAL_ROW% 条)');
					        $show = $page->show();
					        $list = $db->where(['type'=>2,'look'=>0,'ment'=>$apost])->order('time desc')->limit($page->firstRow.','.$page->listRows)->select();
					        $title = '药品耗材审批';
					        $this->assign('list',$list);
					        $this->assign('page',$show);
					        $this->assign('title',$title);
							$this->display('Shenp/findex');
						break;
					case '3':  //经理/总监
						$db = M("cost");
					        // $where = "a_id=".$uid;
					        $count = $db->where(['type'=>2,'look'=>1,'ment'=>$apost])->count();
					        $pagecount = 10;
					        $page = new \Think\Page($count , $pagecount);
					        // $row[] = '';
					        $page->parameter = $row; //此处的row是数组，为了传递查询条件
					        $page->setConfig('first');
					        $page->setConfig('prev','上一页');
					        $page->setConfig('next','下一页');
					        $page->setConfig('last','尾页');
					        $page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% 第 '.I('p',1).' 页/共 %TOTAL_PAGE% 页 ( '.$pagecount.' 条/页 共 %TOTAL_ROW% 条)');
					        $show = $page->show();
					        $list = $db->where(['type'=>2,'look'=>1,'ment'=>$apost])->order('time desc')->limit($page->firstRow.','.$page->listRows)->select();
					        $title = '药品耗材审批';
					        $this->assign('list',$list);
					        $this->assign('page',$show);
					        $this->assign('title',$title);
							$this->display('Shenp/findex');
						break;
					case '4':  //行政
							$db = M("cost");
					        // $where = "a_id=".$uid;
					        $count = $db->where(['type'=>2,'look'=>2])->count();
					        $pagecount = 10;
					        $page = new \Think\Page($count , $pagecount);
					        // $row[] = '';
					        $page->parameter = $row; //此处的row是数组，为了传递查询条件
					        $page->setConfig('first');
					        $page->setConfig('prev','上一页');
					        $page->setConfig('next','下一页');
					        $page->setConfig('last','尾页');
					        $page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% 第 '.I('p',1).' 页/共 %TOTAL_PAGE% 页 ( '.$pagecount.' 条/页 共 %TOTAL_ROW% 条)');
					        $show = $page->show();
					        $list = $db->where(['type'=>2,'look'=>2])->order('time desc')->limit($page->firstRow.','.$page->listRows)->select();
					        $title = '药品耗材审批';
					        $this->assign('list',$list);
					        $this->assign('page',$show);
					        $this->assign('title',$title);
							$this->display('Shenp/findex');
						break;
					case '5':  //财务
							$db = M("cost");
					        // $where = "a_id=".$uid;
					        $count = $db->where(['type'=>2,'look'=>3])->count();
					        $pagecount = 10;
					        $page = new \Think\Page($count , $pagecount);
					        // $row[] = '';
					        $page->parameter = $row; //此处的row是数组，为了传递查询条件
					        $page->setConfig('first');
					        $page->setConfig('prev','上一页');
					        $page->setConfig('next','下一页');
					        $page->setConfig('last','尾页');
					        $page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% 第 '.I('p',1).' 页/共 %TOTAL_PAGE% 页 ( '.$pagecount.' 条/页 共 %TOTAL_ROW% 条)');
					        $show = $page->show();
					        $list = $db->where(['type'=>2,'look'=>3])->order('time desc')->limit($page->firstRow.','.$page->listRows)->select();
					        $title = '药品耗材审批';
					        $this->assign('list',$list);
					        $this->assign('page',$show);
					        $this->assign('title',$title);
							$this->display('Shenp/findex');
						break;
					case '6':  //董事办
							$db = M("cost");
					        // $where = "a_id=".$uid;
					        $count = $db->where(['type'=>2,'look'=>4])->count();
					        $pagecount = 10;
					        $page = new \Think\Page($count , $pagecount);
					        // $row[] = '';
					        $page->parameter = $row; //此处的row是数组，为了传递查询条件
					        $page->setConfig('first');
					        $page->setConfig('prev','上一页');
					        $page->setConfig('next','下一页');
					        $page->setConfig('last','尾页');
					        $page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% 第 '.I('p',1).' 页/共 %TOTAL_PAGE% 页 ( '.$pagecount.' 条/页 共 %TOTAL_ROW% 条)');
					        $show = $page->show();
					        $list = $db->where(['type'=>2,'look'=>4])->order('time desc')->limit($page->firstRow.','.$page->listRows)->select();
					        $title = '药品耗材审批';
					        $this->assign('list',$list);
					        $this->assign('page',$show);
					        $this->assign('title',$title);
							$this->display('Shenp/findex');
						break;
					case '8':  //总经理(网)
							// $apost = $glist[0]['post'];
							$mlist = M('auth_group')->where(['mtype'=>1])->select();

							foreach ($mlist as $vn) {
							// echo $v['n_id'];
							// exit;
							// $ment .= "`ment`="."'".$vn['title']."'"." or ";
							// $ment .= "'".$vn['title']."'"." , ";
								$ments[] =  $vn['title'];
								// 

							}
							 $where = [
			            		'ment' => [
			                		'in',
			                		$ments
			            		],
			            		'look' => 1,
			            		'type'=>2,
			            		'ju'   => 0

			        		];

			    //     			dump($where);
							// exit;
							// $ments = $ment."`look`= 1"." "."or"." "."`ju`= 0";
							
							
							// $ment = "(".rtrim($ment,'or ').")"."AND"."("."`look`= 1"." "."AND"." "."`ju`= 0".")";
							
							// $ment =rtrim($ment,', ');
							// echo $ment;
							// exit;
							$y_list =  M('cost')->where($where)->order('ment DESC')->limit(5)->select();
							// $x_list = "SELECT * FROM oa_look where ment in($ment) AND (`look`= 1 AND `ju`=0)";
							// dump($x_list);
							// exit;
							// $y_list = M('cost')->where(['type'=>1,'look'=>1,'ju'=>0,'ment'=>$ment])->order('id DESC')->limit(5)->select();
							// $this->assign('x_list',$x_list);
							$this->assign('y_list',$y_list);
							$this->display();
							break;
					case '9':  //总经理(职)
							// $apost = $glist[0]['post'];
							$mlist = M('auth_group')->where(['mtype'=>2])->select();
							// dump($mlist);
							// exit;
							foreach ($mlist as $vn) {
							// echo $v['n_id'];
							// exit;
							// $ment .= "`ment`="."'".$vn['title']."'"." or ";
							// $ment .= "'".$vn['title']."'"." , ";
								$ments[] =  $vn['title'];
								// 

							}
							 $where = [
			            		'ment' => [
			                		'in',
			                		$ments
			            		],
			            		'look' => 1,
			            		'type'=>2,
			            		'ju'   => 0

			        		];

			    //     			dump($where);
							// exit;
							// $ments = $ment."`look`= 1"." "."or"." "."`ju`= 0";
							
							
							// $ment = "(".rtrim($ment,'or ').")"."AND"."("."`look`= 1"." "."AND"." "."`ju`= 0".")";
							
							// $ment =rtrim($ment,', ');
							// echo $ment;
							// exit;
							$y_list =  M('cost')->where($where)->order('ment DESC')->limit(5)->select();
							// $x_list = "SELECT * FROM oa_look where ment in($ment) AND (`look`= 1 AND `ju`=0)";
							// dump($x_list);
							// exit;
							// $y_list = M('cost')->where(['type'=>1,'look'=>1,'ju'=>0,'ment'=>$ment])->order('id DESC')->limit(5)->select();
							// $this->assign('x_list',$x_list);
							$this->assign('y_list',$y_list);
							$this->display();
						break;


					
				}	
				break;



			case '3': //行政借款审批
				switch ($ulist[0]['m_type']) {
					case '2':   //主管
							$db = M("cost");
					        // $where = "a_id=".$uid;
					        $count = $db->where(['type'=>3,'look'=>0,'ment'=>$apost])->count();
					        $pagecount = 10;
					        $page = new \Think\Page($count , $pagecount);
					        // $row[] = '';
					        $page->parameter = $row; //此处的row是数组，为了传递查询条件
					        $page->setConfig('first');
					        $page->setConfig('prev','上一页');
					        $page->setConfig('next','下一页');
					        $page->setConfig('last','尾页');
					        $page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% 第 '.I('p',1).' 页/共 %TOTAL_PAGE% 页 ( '.$pagecount.' 条/页 共 %TOTAL_ROW% 条)');
					        $show = $page->show();
					        $list = $db->where(['type'=>3,'look'=>0,'ment'=>$apost])->order('time desc')->limit($page->firstRow.','.$page->listRows)->select();
					        $title = '行政借款审批';
					        $this->assign('list',$list);
					        $this->assign('page',$show);
					        $this->assign('title',$title);
							$this->display('Shenp/findex');
						break;
					case '3':  //经理/总监
						$db = M("cost");
					        // $where = "a_id=".$uid;
					        $count = $db->where(['type'=>3,'look'=>1,'ment'=>$apost])->count();
					        $pagecount = 10;
					        $page = new \Think\Page($count , $pagecount);
					        // $row[] = '';
					        $page->parameter = $row; //此处的row是数组，为了传递查询条件
					        $page->setConfig('first');
					        $page->setConfig('prev','上一页');
					        $page->setConfig('next','下一页');
					        $page->setConfig('last','尾页');
					        $page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% 第 '.I('p',1).' 页/共 %TOTAL_PAGE% 页 ( '.$pagecount.' 条/页 共 %TOTAL_ROW% 条)');
					        $show = $page->show();
					        $list = $db->where(['type'=>3,'look'=>1,'ment'=>$apost])->order('time desc')->limit($page->firstRow.','.$page->listRows)->select();
					        $title = '行政借款审批';
					        $this->assign('list',$list);
					        $this->assign('page',$show);
					        $this->assign('title',$title);
							$this->display('Shenp/findex');
						break;
					case '4':  //行政
							$db = M("cost");
					        // $where = "a_id=".$uid;
					        $count = $db->where(['type'=>3,'look'=>2])->count();
					        $pagecount = 10;
					        $page = new \Think\Page($count , $pagecount);
					        // $row[] = '';
					        $page->parameter = $row; //此处的row是数组，为了传递查询条件
					        $page->setConfig('first');
					        $page->setConfig('prev','上一页');
					        $page->setConfig('next','下一页');
					        $page->setConfig('last','尾页');
					        $page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% 第 '.I('p',1).' 页/共 %TOTAL_PAGE% 页 ( '.$pagecount.' 条/页 共 %TOTAL_ROW% 条)');
					        $show = $page->show();
					        $list = $db->where(['type'=>3,'look'=>2])->order('time desc')->limit($page->firstRow.','.$page->listRows)->select();
					        $title = '行政借款审批';
					        $this->assign('list',$list);
					        $this->assign('page',$show);
					        $this->assign('title',$title);
							$this->display('Shenp/findex');
						break;
					case '5':  //财务
							$db = M("cost");
					        // $where = "a_id=".$uid;
					        $count = $db->where(['type'=>3,'look'=>3])->count();
					        $pagecount = 10;
					        $page = new \Think\Page($count , $pagecount);
					        // $row[] = '';
					        $page->parameter = $row; //此处的row是数组，为了传递查询条件
					        $page->setConfig('first');
					        $page->setConfig('prev','上一页');
					        $page->setConfig('next','下一页');
					        $page->setConfig('last','尾页');
					        $page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% 第 '.I('p',1).' 页/共 %TOTAL_PAGE% 页 ( '.$pagecount.' 条/页 共 %TOTAL_ROW% 条)');
					        $show = $page->show();
					        $list = $db->where(['type'=>3,'look'=>3])->order('time desc')->limit($page->firstRow.','.$page->listRows)->select();
					        $title = '行政借款审批';
					        $this->assign('list',$list);
					        $this->assign('page',$show);
					        $this->assign('title',$title);
							$this->display('Shenp/findex');
						break;
					case '6':  //董事办
							$db = M("cost");
					        // $where = "a_id=".$uid;
					        $count = $db->where(['type'=>3,'look'=>4])->count();
					        $pagecount = 10;
					        $page = new \Think\Page($count , $pagecount);
					        // $row[] = '';
					        $page->parameter = $row; //此处的row是数组，为了传递查询条件
					        $page->setConfig('first');
					        $page->setConfig('prev','上一页');
					        $page->setConfig('next','下一页');
					        $page->setConfig('last','尾页');
					        $page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% 第 '.I('p',1).' 页/共 %TOTAL_PAGE% 页 ( '.$pagecount.' 条/页 共 %TOTAL_ROW% 条)');
					        $show = $page->show();
					        $list = $db->where(['type'=>3,'look'=>4])->order('time desc')->limit($page->firstRow.','.$page->listRows)->select();
					        $title = '行政借款审批';
					        $this->assign('list',$list);
					        $this->assign('page',$show);
					        $this->assign('title',$title);
							$this->display('Shenp/findex');
						break;
					case '8':  //总经理(网)
							// $apost = $glist[0]['post'];
							$mlist = M('auth_group')->where(['mtype'=>1])->select();

							foreach ($mlist as $vn) {
							// echo $v['n_id'];
							// exit;
							// $ment .= "`ment`="."'".$vn['title']."'"." or ";
							// $ment .= "'".$vn['title']."'"." , ";
								$ments[] =  $vn['title'];
								// 

							}
							 $where = [
			            		'ment' => [
			                		'in',
			                		$ments
			            		],
			            		'look' => 1,
			            		'type'=>3,
			            		'ju'   => 0

			        		];

			    //     			dump($where);
							// exit;
							// $ments = $ment."`look`= 1"." "."or"." "."`ju`= 0";
							
							
							// $ment = "(".rtrim($ment,'or ').")"."AND"."("."`look`= 1"." "."AND"." "."`ju`= 0".")";
							
							// $ment =rtrim($ment,', ');
							// echo $ment;
							// exit;
							$y_list =  M('cost')->where($where)->order('ment DESC')->limit(5)->select();
							// $x_list = "SELECT * FROM oa_look where ment in($ment) AND (`look`= 1 AND `ju`=0)";
							// dump($x_list);
							// exit;
							// $y_list = M('cost')->where(['type'=>1,'look'=>1,'ju'=>0,'ment'=>$ment])->order('id DESC')->limit(5)->select();
							// $this->assign('x_list',$x_list);
							$this->assign('y_list',$y_list);
							$this->display();
							break;
					case '9':  //总经理(职)
							// $apost = $glist[0]['post'];
							$mlist = M('auth_group')->where(['mtype'=>2])->select();
							// dump($mlist);
							// exit;
							foreach ($mlist as $vn) {
							// echo $v['n_id'];
							// exit;
							// $ment .= "`ment`="."'".$vn['title']."'"." or ";
							// $ment .= "'".$vn['title']."'"." , ";
								$ments[] =  $vn['title'];
								// 

							}
							 $where = [
			            		'ment' => [
			                		'in',
			                		$ments
			            		],
			            		'look' => 1,
			            		'type'=>3,
			            		'ju'   => 0

			        		];

			    //     			dump($where);
							// exit;
							// $ments = $ment."`look`= 1"." "."or"." "."`ju`= 0";
							
							
							// $ment = "(".rtrim($ment,'or ').")"."AND"."("."`look`= 1"." "."AND"." "."`ju`= 0".")";
							
							// $ment =rtrim($ment,', ');
							// echo $ment;
							// exit;
							$y_list =  M('cost')->where($where)->order('ment DESC')->limit(5)->select();
							// $x_list = "SELECT * FROM oa_look where ment in($ment) AND (`look`= 1 AND `ju`=0)";
							// dump($x_list);
							// exit;
							// $y_list = M('cost')->where(['type'=>1,'look'=>1,'ju'=>0,'ment'=>$ment])->order('id DESC')->limit(5)->select();
							// $this->assign('x_list',$x_list);
							$this->assign('y_list',$y_list);
							$this->display();
						break;


					
				}	


				break;


			case '4':  //户外费用审批
				switch ($ulist[0]['m_type']) {
					case '2':   //主管
							$db = M("cost");
					        // $where = "a_id=".$uid;
					        $count = $db->where(['type'=>4,'look'=>0,'ment'=>$apost])->count();
					        $pagecount = 10;
					        $page = new \Think\Page($count , $pagecount);
					        // $row[] = '';
					        $page->parameter = $row; //此处的row是数组，为了传递查询条件
					        $page->setConfig('first');
					        $page->setConfig('prev','上一页');
					        $page->setConfig('next','下一页');
					        $page->setConfig('last','尾页');
					        $page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% 第 '.I('p',1).' 页/共 %TOTAL_PAGE% 页 ( '.$pagecount.' 条/页 共 %TOTAL_ROW% 条)');
					        $show = $page->show();
					        $list = $db->where(['type'=>4,'look'=>0,'ment'=>$apost])->order('time desc')->limit($page->firstRow.','.$page->listRows)->select();
					        $title = '户外费用审批';
					        $this->assign('list',$list);
					        $this->assign('page',$show);
					        $this->assign('title',$title);
							$this->display('Shenp/findex');
						break;
					case '3':  //经理/总监
						$db = M("cost");
					        // $where = "a_id=".$uid;
					        $count = $db->where(['type'=>4,'look'=>1,'ment'=>$apost])->count();
					        $pagecount = 10;
					        $page = new \Think\Page($count , $pagecount);
					        // $row[] = '';
					        $page->parameter = $row; //此处的row是数组，为了传递查询条件
					        $page->setConfig('first');
					        $page->setConfig('prev','上一页');
					        $page->setConfig('next','下一页');
					        $page->setConfig('last','尾页');
					        $page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% 第 '.I('p',1).' 页/共 %TOTAL_PAGE% 页 ( '.$pagecount.' 条/页 共 %TOTAL_ROW% 条)');
					        $show = $page->show();
					        $list = $db->where(['type'=>4,'look'=>1,'ment'=>$apost])->order('time desc')->limit($page->firstRow.','.$page->listRows)->select();
					        $title = '户外费用审批';
					        $this->assign('list',$list);
					        $this->assign('page',$show);
					        $this->assign('title',$title);
							$this->display('Shenp/findex');
						break;
					case '4':  //行政
							$db = M("cost");
					        // $where = "a_id=".$uid;
					        $count = $db->where(['type'=>4,'look'=>2])->count();
					        $pagecount = 10;
					        $page = new \Think\Page($count , $pagecount);
					        // $row[] = '';
					        $page->parameter = $row; //此处的row是数组，为了传递查询条件
					        $page->setConfig('first');
					        $page->setConfig('prev','上一页');
					        $page->setConfig('next','下一页');
					        $page->setConfig('last','尾页');
					        $page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% 第 '.I('p',1).' 页/共 %TOTAL_PAGE% 页 ( '.$pagecount.' 条/页 共 %TOTAL_ROW% 条)');
					        $show = $page->show();
					        $list = $db->where(['type'=>4,'look'=>2])->order('time desc')->limit($page->firstRow.','.$page->listRows)->select();
					        $title = '户外费用审批';
					        $this->assign('list',$list);
					        $this->assign('page',$show);
					        $this->assign('title',$title);
							$this->display('Shenp/findex');
						break;
					case '5':  //财务
							$db = M("cost");
					        // $where = "a_id=".$uid;
					        $count = $db->where(['type'=>4,'look'=>3])->count();
					        $pagecount = 10;
					        $page = new \Think\Page($count , $pagecount);
					        // $row[] = '';
					        $page->parameter = $row; //此处的row是数组，为了传递查询条件
					        $page->setConfig('first');
					        $page->setConfig('prev','上一页');
					        $page->setConfig('next','下一页');
					        $page->setConfig('last','尾页');
					        $page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% 第 '.I('p',1).' 页/共 %TOTAL_PAGE% 页 ( '.$pagecount.' 条/页 共 %TOTAL_ROW% 条)');
					        $show = $page->show();
					        $list = $db->where(['type'=>4,'look'=>3])->order('time desc')->limit($page->firstRow.','.$page->listRows)->select();
					        $title = '户外费用审批';
					        $this->assign('list',$list);
					        $this->assign('page',$show);
					        $this->assign('title',$title);
							$this->display('Shenp/findex');
						break;
					case '6':  //董事办
							$db = M("cost");
					        // $where = "a_id=".$uid;
					        $count = $db->where(['type'=>4,'look'=>4])->count();
					        $pagecount = 10;
					        $page = new \Think\Page($count , $pagecount);
					        // $row[] = '';
					        $page->parameter = $row; //此处的row是数组，为了传递查询条件
					        $page->setConfig('first');
					        $page->setConfig('prev','上一页');
					        $page->setConfig('next','下一页');
					        $page->setConfig('last','尾页');
					        $page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% 第 '.I('p',1).' 页/共 %TOTAL_PAGE% 页 ( '.$pagecount.' 条/页 共 %TOTAL_ROW% 条)');
					        $show = $page->show();
					        $list = $db->where(['type'=>4,'look'=>4])->order('time desc')->limit($page->firstRow.','.$page->listRows)->select();
					        $title = '户外费用审批';
					        $this->assign('list',$list);
					        $this->assign('page',$show);
					        $this->assign('title',$title);
							$this->display('Shenp/findex');
						break;
					
					case '8':  //总经理(网)
							// $apost = $glist[0]['post'];
							$mlist = M('auth_group')->where(['mtype'=>1])->select();

							foreach ($mlist as $vn) {
							// echo $v['n_id'];
							// exit;
							// $ment .= "`ment`="."'".$vn['title']."'"." or ";
							// $ment .= "'".$vn['title']."'"." , ";
								$ments[] =  $vn['title'];
								// 

							}
							 $where = [
			            		'ment' => [
			                		'in',
			                		$ments
			            		],
			            		'look' => 1,
			            		'type'=>4,
			            		'ju'   => 0

			        		];

			    //     			dump($where);
							// exit;
							// $ments = $ment."`look`= 1"." "."or"." "."`ju`= 0";
							
							
							// $ment = "(".rtrim($ment,'or ').")"."AND"."("."`look`= 1"." "."AND"." "."`ju`= 0".")";
							
							// $ment =rtrim($ment,', ');
							// echo $ment;
							// exit;
							$y_list =  M('cost')->where($where)->order('ment DESC')->limit(5)->select();
							// $x_list = "SELECT * FROM oa_look where ment in($ment) AND (`look`= 1 AND `ju`=0)";
							// dump($x_list);
							// exit;
							// $y_list = M('cost')->where(['type'=>1,'look'=>1,'ju'=>0,'ment'=>$ment])->order('id DESC')->limit(5)->select();
							// $this->assign('x_list',$x_list);
							$this->assign('y_list',$y_list);
							$this->display();
							break;
					case '9':  //总经理(职)
							// $apost = $glist[0]['post'];
							$mlist = M('auth_group')->where(['mtype'=>2])->select();
							// dump($mlist);
							// exit;
							foreach ($mlist as $vn) {
							// echo $v['n_id'];
							// exit;
							// $ment .= "`ment`="."'".$vn['title']."'"." or ";
							// $ment .= "'".$vn['title']."'"." , ";
								$ments[] =  $vn['title'];
								// 

							}
							 $where = [
			            		'ment' => [
			                		'in',
			                		$ments
			            		],
			            		'look' => 1,
			            		'type'=>4,
			            		'ju'   => 0

			        		];

			    //     			dump($where);
							// exit;
							// $ments = $ment."`look`= 1"." "."or"." "."`ju`= 0";
							
							
							// $ment = "(".rtrim($ment,'or ').")"."AND"."("."`look`= 1"." "."AND"." "."`ju`= 0".")";
							
							// $ment =rtrim($ment,', ');
							// echo $ment;
							// exit;
							$y_list =  M('cost')->where($where)->order('ment DESC')->limit(5)->select();
							// $x_list = "SELECT * FROM oa_look where ment in($ment) AND (`look`= 1 AND `ju`=0)";
							// dump($x_list);
							// exit;
							// $y_list = M('cost')->where(['type'=>1,'look'=>1,'ju'=>0,'ment'=>$ment])->order('id DESC')->limit(5)->select();
							// $this->assign('x_list',$x_list);
							$this->assign('y_list',$y_list);
							$this->display();
						break;

					
				}

				
					
				break;







			case '5':  //网络费用审批
				switch ($ulist[0]['m_type']) {
					case '2':   //主管
							$db = M("cost");
					        // $where = "a_id=".$uid;
					        $count = $db->where(['type'=>5,'look'=>0,'ment'=>$apost])->count();
					        $pagecount = 10;
					        $page = new \Think\Page($count , $pagecount);
					        // $row[] = '';
					        $page->parameter = $row; //此处的row是数组，为了传递查询条件
					        $page->setConfig('first');
					        $page->setConfig('prev','上一页');
					        $page->setConfig('next','下一页');
					        $page->setConfig('last','尾页');
					        $page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% 第 '.I('p',1).' 页/共 %TOTAL_PAGE% 页 ( '.$pagecount.' 条/页 共 %TOTAL_ROW% 条)');
					        $show = $page->show();
					        $list = $db->where(['type'=>5,'look'=>0,'ment'=>$apost])->order('time desc')->limit($page->firstRow.','.$page->listRows)->select();
					        $title = '网络费用审批';
					        $this->assign('list',$list);
					        $this->assign('page',$show);
					        $this->assign('title',$title);
							$this->display('Shenp/findex');
						break;
					case '3':  //经理/总监
						$db = M("cost");
					        // $where = "a_id=".$uid;
					        $count = $db->where(['type'=>5,'look'=>1,'ment'=>$apost])->count();
					        $pagecount = 10;
					        $page = new \Think\Page($count , $pagecount);
					        // $row[] = '';
					        $page->parameter = $row; //此处的row是数组，为了传递查询条件
					        $page->setConfig('first');
					        $page->setConfig('prev','上一页');
					        $page->setConfig('next','下一页');
					        $page->setConfig('last','尾页');
					        $page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% 第 '.I('p',1).' 页/共 %TOTAL_PAGE% 页 ( '.$pagecount.' 条/页 共 %TOTAL_ROW% 条)');
					        $show = $page->show();
					        $list = $db->where(['type'=>5,'look'=>1,'ment'=>$apost])->order('time desc')->limit($page->firstRow.','.$page->listRows)->select();
					        $title = '网络费用审批';
					        $this->assign('list',$list);
					        $this->assign('page',$show);
					        $this->assign('title',$title);
							$this->display('Shenp/findex');
						break;
					case '4':  //行政
							$db = M("cost");
					        // $where = "a_id=".$uid;
					        $count = $db->where(['type'=>5,'look'=>2])->count();
					        $pagecount = 10;
					        $page = new \Think\Page($count , $pagecount);
					        // $row[] = '';
					        $page->parameter = $row; //此处的row是数组，为了传递查询条件
					        $page->setConfig('first');
					        $page->setConfig('prev','上一页');
					        $page->setConfig('next','下一页');
					        $page->setConfig('last','尾页');
					        $page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% 第 '.I('p',1).' 页/共 %TOTAL_PAGE% 页 ( '.$pagecount.' 条/页 共 %TOTAL_ROW% 条)');
					        $show = $page->show();
					        $list = $db->where(['type'=>5,'look'=>2])->order('time desc')->limit($page->firstRow.','.$page->listRows)->select();
					        $title = '网络费用审批';
					        $this->assign('list',$list);
					        $this->assign('page',$show);
					        $this->assign('title',$title);
							$this->display('Shenp/findex');
						break;
					case '5':  //财务
							$db = M("cost");
					        // $where = "a_id=".$uid;
					        $count = $db->where(['type'=>5,'look'=>3])->count();
					        $pagecount = 10;
					        $page = new \Think\Page($count , $pagecount);
					        // $row[] = '';
					        $page->parameter = $row; //此处的row是数组，为了传递查询条件
					        $page->setConfig('first');
					        $page->setConfig('prev','上一页');
					        $page->setConfig('next','下一页');
					        $page->setConfig('last','尾页');
					        $page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% 第 '.I('p',1).' 页/共 %TOTAL_PAGE% 页 ( '.$pagecount.' 条/页 共 %TOTAL_ROW% 条)');
					        $show = $page->show();
					        $list = $db->where(['type'=>5,'look'=>3])->order('time desc')->limit($page->firstRow.','.$page->listRows)->select();
					        $title = '网络费用审批';
					        $this->assign('list',$list);
					        $this->assign('page',$show);
					        $this->assign('title',$title);
							$this->display('Shenp/findex');
						break;
					case '6':  //董事办
							$db = M("cost");
					        // $where = "a_id=".$uid;
					        $count = $db->where(['type'=>5,'look'=>4])->count();
					        $pagecount = 10;
					        $page = new \Think\Page($count , $pagecount);
					        // $row[] = '';
					        $page->parameter = $row; //此处的row是数组，为了传递查询条件
					        $page->setConfig('first');
					        $page->setConfig('prev','上一页');
					        $page->setConfig('next','下一页');
					        $page->setConfig('last','尾页');
					        $page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% 第 '.I('p',1).' 页/共 %TOTAL_PAGE% 页 ( '.$pagecount.' 条/页 共 %TOTAL_ROW% 条)');
					        $show = $page->show();
					        $list = $db->where(['type'=>5,'look'=>4])->order('time desc')->limit($page->firstRow.','.$page->listRows)->select();
					        $title = '网络费用审批';
					        $this->assign('list',$list);
					        $this->assign('page',$show);
					        $this->assign('title',$title);
							$this->display('Shenp/findex');
						break;
					
					case '8':  //总经理(网)
							// $apost = $glist[0]['post'];
							$mlist = M('auth_group')->where(['mtype'=>1])->select();

							foreach ($mlist as $vn) {
							// echo $v['n_id'];
							// exit;
							// $ment .= "`ment`="."'".$vn['title']."'"." or ";
							// $ment .= "'".$vn['title']."'"." , ";
								$ments[] =  $vn['title'];
								// 

							}
							 $where = [
			            		'ment' => [
			                		'in',
			                		$ments
			            		],
			            		'look' => 1,
			            		'type'=>5,
			            		'ju'   => 0

			        		];

			    //     			dump($where);
							// exit;
							// $ments = $ment."`look`= 1"." "."or"." "."`ju`= 0";
							
							
							// $ment = "(".rtrim($ment,'or ').")"."AND"."("."`look`= 1"." "."AND"." "."`ju`= 0".")";
							
							// $ment =rtrim($ment,', ');
							// echo $ment;
							// exit;
							$y_list =  M('cost')->where($where)->order('ment DESC')->limit(5)->select();
							// $x_list = "SELECT * FROM oa_look where ment in($ment) AND (`look`= 1 AND `ju`=0)";
							// dump($x_list);
							// exit;
							// $y_list = M('cost')->where(['type'=>1,'look'=>1,'ju'=>0,'ment'=>$ment])->order('id DESC')->limit(5)->select();
							// $this->assign('x_list',$x_list);
							$this->assign('y_list',$y_list);
							$this->display();
							break;
					case '9':  //总经理(职)
							// $apost = $glist[0]['post'];
							$mlist = M('auth_group')->where(['mtype'=>2])->select();
							// dump($mlist);
							// exit;
							foreach ($mlist as $vn) {
							// echo $v['n_id'];
							// exit;
							// $ment .= "`ment`="."'".$vn['title']."'"." or ";
							// $ment .= "'".$vn['title']."'"." , ";
								$ments[] =  $vn['title'];
								// 

							}
							 $where = [
			            		'ment' => [
			                		'in',
			                		$ments
			            		],
			            		'look' => 1,
			            		'type'=>5,
			            		'ju'   => 0

			        		];

			    //     			dump($where);
							// exit;
							// $ments = $ment."`look`= 1"." "."or"." "."`ju`= 0";
							
							
							// $ment = "(".rtrim($ment,'or ').")"."AND"."("."`look`= 1"." "."AND"." "."`ju`= 0".")";
							
							// $ment =rtrim($ment,', ');
							// echo $ment;
							// exit;
							$y_list =  M('cost')->where($where)->order('ment DESC')->limit(5)->select();
							// $x_list = "SELECT * FROM oa_look where ment in($ment) AND (`look`= 1 AND `ju`=0)";
							// dump($x_list);
							// exit;
							// $y_list = M('cost')->where(['type'=>1,'look'=>1,'ju'=>0,'ment'=>$ment])->order('id DESC')->limit(5)->select();
							// $this->assign('x_list',$x_list);
							$this->assign('y_list',$y_list);
							$this->display();
						break;

					
				}
					
				break;


			case '6': //电视费用审批
				switch ($ulist[0]['m_type']) {
					case '2':   //主管
							$db = M("cost");
					        // $where = "a_id=".$uid;
					        $count = $db->where(['type'=>6,'look'=>0,'ment'=>$apost])->count();
					        $pagecount = 10;
					        $page = new \Think\Page($count , $pagecount);
					        // $row[] = '';
					        $page->parameter = $row; //此处的row是数组，为了传递查询条件
					        $page->setConfig('first');
					        $page->setConfig('prev','上一页');
					        $page->setConfig('next','下一页');
					        $page->setConfig('last','尾页');
					        $page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% 第 '.I('p',1).' 页/共 %TOTAL_PAGE% 页 ( '.$pagecount.' 条/页 共 %TOTAL_ROW% 条)');
					        $show = $page->show();
					        $list = $db->where(['type'=>6,'look'=>0,'ment'=>$apost])->order('time desc')->limit($page->firstRow.','.$page->listRows)->select();
					        $title = '电视费用审批';
					        $this->assign('list',$list);
					        $this->assign('page',$show);
					        $this->assign('title',$title);
							$this->display('Shenp/findex');
						break;
					case '3':  //经理/总监
						$db = M("cost");
					        // $where = "a_id=".$uid;
					        $count = $db->where(['type'=>6,'look'=>1,'ment'=>$apost])->count();
					        $pagecount = 10;
					        $page = new \Think\Page($count , $pagecount);
					        // $row[] = '';
					        $page->parameter = $row; //此处的row是数组，为了传递查询条件
					        $page->setConfig('first');
					        $page->setConfig('prev','上一页');
					        $page->setConfig('next','下一页');
					        $page->setConfig('last','尾页');
					        $page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% 第 '.I('p',1).' 页/共 %TOTAL_PAGE% 页 ( '.$pagecount.' 条/页 共 %TOTAL_ROW% 条)');
					        $show = $page->show();
					        $list = $db->where(['type'=>6,'look'=>1,'ment'=>$apost])->order('time desc')->limit($page->firstRow.','.$page->listRows)->select();
					        $title = '电视费用审批';
					        $this->assign('list',$list);
					        $this->assign('page',$show);
					        $this->assign('title',$title);
							$this->display('Shenp/findex');
						break;
					case '4':  //行政
							$db = M("cost");
					        // $where = "a_id=".$uid;
					        $count = $db->where(['type'=>6,'look'=>2])->count();
					        $pagecount = 10;
					        $page = new \Think\Page($count , $pagecount);
					        // $row[] = '';
					        $page->parameter = $row; //此处的row是数组，为了传递查询条件
					        $page->setConfig('first');
					        $page->setConfig('prev','上一页');
					        $page->setConfig('next','下一页');
					        $page->setConfig('last','尾页');
					        $page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% 第 '.I('p',1).' 页/共 %TOTAL_PAGE% 页 ( '.$pagecount.' 条/页 共 %TOTAL_ROW% 条)');
					        $show = $page->show();
					        $list = $db->where(['type'=>6,'look'=>2])->order('time desc')->limit($page->firstRow.','.$page->listRows)->select();
					        $title = '电视费用审批';
					        $this->assign('list',$list);
					        $this->assign('page',$show);
					        $this->assign('title',$title);
							$this->display('Shenp/findex');
						break;
					case '5':  //财务
							$db = M("cost");
					        // $where = "a_id=".$uid;
					        $count = $db->where(['type'=>6,'look'=>3])->count();
					        $pagecount = 10;
					        $page = new \Think\Page($count , $pagecount);
					        // $row[] = '';
					        $page->parameter = $row; //此处的row是数组，为了传递查询条件
					        $page->setConfig('first');
					        $page->setConfig('prev','上一页');
					        $page->setConfig('next','下一页');
					        $page->setConfig('last','尾页');
					        $page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% 第 '.I('p',1).' 页/共 %TOTAL_PAGE% 页 ( '.$pagecount.' 条/页 共 %TOTAL_ROW% 条)');
					        $show = $page->show();
					        $list = $db->where(['type'=>6,'look'=>3])->order('time desc')->limit($page->firstRow.','.$page->listRows)->select();
					        $title = '电视费用审批';
					        $this->assign('list',$list);
					        $this->assign('page',$show);
					        $this->assign('title',$title);
							$this->display('Shenp/findex');
						break;
					case '6':  //董事办
							$db = M("cost");
					        // $where = "a_id=".$uid;
					        $count = $db->where(['type'=>6,'look'=>4])->count();
					        $pagecount = 10;
					        $page = new \Think\Page($count , $pagecount);
					        // $row[] = '';
					        $page->parameter = $row; //此处的row是数组，为了传递查询条件
					        $page->setConfig('first');
					        $page->setConfig('prev','上一页');
					        $page->setConfig('next','下一页');
					        $page->setConfig('last','尾页');
					        $page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% 第 '.I('p',1).' 页/共 %TOTAL_PAGE% 页 ( '.$pagecount.' 条/页 共 %TOTAL_ROW% 条)');
					        $show = $page->show();
					        $list = $db->where(['type'=>6,'look'=>4])->order('time desc')->limit($page->firstRow.','.$page->listRows)->select();
					        $title = '电视费用审批';
					        $this->assign('list',$list);
					        $this->assign('page',$show);
					        $this->assign('title',$title);
							$this->display('Shenp/findex');
						break;
					
					case '8':  //总经理(网)
							// $apost = $glist[0]['post'];
							$mlist = M('auth_group')->where(['mtype'=>1])->select();

							foreach ($mlist as $vn) {
							// echo $v['n_id'];
							// exit;
							// $ment .= "`ment`="."'".$vn['title']."'"." or ";
							// $ment .= "'".$vn['title']."'"." , ";
								$ments[] =  $vn['title'];
								// 

							}
							 $where = [
			            		'ment' => [
			                		'in',
			                		$ments
			            		],
			            		'look' => 1,
			            		'type'=>6,
			            		'ju'   => 0

			        		];

			    //     			dump($where);
							// exit;
							// $ments = $ment."`look`= 1"." "."or"." "."`ju`= 0";
							
							
							// $ment = "(".rtrim($ment,'or ').")"."AND"."("."`look`= 1"." "."AND"." "."`ju`= 0".")";
							
							// $ment =rtrim($ment,', ');
							// echo $ment;
							// exit;
							$y_list =  M('cost')->where($where)->order('ment DESC')->limit(5)->select();
							// $x_list = "SELECT * FROM oa_look where ment in($ment) AND (`look`= 1 AND `ju`=0)";
							// dump($x_list);
							// exit;
							// $y_list = M('cost')->where(['type'=>1,'look'=>1,'ju'=>0,'ment'=>$ment])->order('id DESC')->limit(5)->select();
							// $this->assign('x_list',$x_list);
							$this->assign('y_list',$y_list);
							$this->display();
							break;
					case '9':  //总经理(职)
							// $apost = $glist[0]['post'];
							$mlist = M('auth_group')->where(['mtype'=>2])->select();
							// dump($mlist);
							// exit;
							foreach ($mlist as $vn) {
							// echo $v['n_id'];
							// exit;
							// $ment .= "`ment`="."'".$vn['title']."'"." or ";
							// $ment .= "'".$vn['title']."'"." , ";
								$ments[] =  $vn['title'];
								// 

							}
							 $where = [
			            		'ment' => [
			                		'in',
			                		$ments
			            		],
			            		'look' => 1,
			            		'type'=>6,
			            		'ju'   => 0

			        		];

			    //     			dump($where);
							// exit;
							// $ments = $ment."`look`= 1"." "."or"." "."`ju`= 0";
							
							
							// $ment = "(".rtrim($ment,'or ').")"."AND"."("."`look`= 1"." "."AND"." "."`ju`= 0".")";
							
							// $ment =rtrim($ment,', ');
							// echo $ment;
							// exit;
							$y_list =  M('cost')->where($where)->order('ment DESC')->limit(5)->select();
							// $x_list = "SELECT * FROM oa_look where ment in($ment) AND (`look`= 1 AND `ju`=0)";
							// dump($x_list);
							// exit;
							// $y_list = M('cost')->where(['type'=>1,'look'=>1,'ju'=>0,'ment'=>$ment])->order('id DESC')->limit(5)->select();
							// $this->assign('x_list',$x_list);
							$this->assign('y_list',$y_list);
							$this->display();
						break;

					
				}
					
				break;
			
			// $this->display();
		}
	}







	public function xsh()    //办公用品领用审批单项审批(通过)
	{
		
		// dump($_POST);
		// exit;
		$sid = $_POST['id'];
		$slist = M('look')->where(['id'=>$sid])->select();//查询物资类型
		// echo $slist[0]['type'];
		// exit;
		switch ($slist[0]['type']) {
			case '1':   //急性审批
				$sid = $_POST['id'];
				$slist = M('look')->where(['id'=>$sid])->select();//查询申请物资信息
				$ulist = M('member')->where(['uid'=>$_SESSION['uid']])->select();
				$alist = M('auth_group_access')->where(['uid'=>$_SESSION['uid']])->select();
				$glist = M('auth_group')->where(['id'=>$alist[0]['group_id']])->select();
				$data['sid'] = $sid;
				$data['stype'] = '1';
				$data['wtype'] = '急性物品申购';
				switch ($ulist[0]['m_type']) {
					case '2': //主管
						
						$data['ztype'] = $ulist[0]['m_type'];
						$data['zname'] = $ulist[0]['user'];
						$data['ztime'] = date('Y-m-d');
						$look['look'] = '1';
						if (M('sh')->add($data) > 0) {
							if (M('look')->where(['id'=>$sid])->save($look) > 0) {
								echo '1111';
							}
						}
						break;
					case '3': //经理
						switch ($glist[0]['post']) {
							case '行政中心':
								$ylist = M('sh')->where(['sid'=>$sid])->find();
								
								if (empty($ylist['jname'])) {
									$data['jtype'] = $ulist[0]['m_type'];
									$data['jname'] = $ulist[0]['user'];
									$data['jtime'] = date('Y-m-d');
									$look['look'] = '2';
									if (M('sh')->where(['sid'=>$sid])->save($data) > 0) {
										if (M('look')->where(['id'=>$sid])->save($look) > 0) {
											echo '1111';
										}
									}
								}else{
									$data['xtype'] = $ulist[0]['m_type'];
									$data['xname'] = $ulist[0]['user'];
									$data['xtime'] = date('Y-m-d');
									$look['look'] = '3';
									if (M('sh')->where(['sid'=>$sid])->save($data) > 0) {
										if (M('look')->where(['id'=>$sid])->save($look) > 0) {
											echo '1111';
										}
									}
								}
								
								break;
							case '采购中心':
								$data['jtype'] = $ulist[0]['m_type'];
								$data['jname'] = $ulist[0]['user'];
								$data['jtime'] = date('Y-m-d');
								$look['look'] = '2';
								if (M('sh')->where(['sid'=>$sid])->save($data) > 0) {
									if (M('look')->where(['id'=>$sid])->save($look) > 0) {
										echo '1111';
									}
								}
								break;
							case '财务中心':
								$ylist = M('sh')->where(['sid'=>$sid])->find();
								
								if (empty($ylist['jname'])) {
									$data['jtype'] = $ulist[0]['m_type'];
									$data['jname'] = $ulist[0]['user'];
									$data['jtime'] = date('Y-m-d');
									$look['look'] = '2';
									if (M('sh')->where(['sid'=>$sid])->save($data) > 0) {
										if (M('look')->where(['id'=>$sid])->save($look) > 0) {
											echo '1111';
										}
									}
								}else{
									$data['ctype'] = $ulist[0]['m_type'];
									$data['cname'] = $ulist[0]['user'];
									$data['ctime'] = date('Y-m-d');
									$look['look'] = '4';
									if (M('sh')->where(['sid'=>$sid])->save($data) > 0) {
										if (M('look')->where(['id'=>$sid])->save($look) > 0) {
											echo '1111';
										}
									}
								}
								break;
							
						}
					
						break;

					case '4': //行政
					// echo'111';
					// exit;
						$data['xtype'] = $ulist[0]['m_type'];
						$data['xname'] = $ulist[0]['user'];
						$data['xtime'] = date('Y-m-d');
						$look['look'] = '3';
						if (M('sh')->where(['sid'=>$sid])->save($data) > 0) {
							if (M('look')->where(['id'=>$sid])->save($look) > 0) {
								echo '1111';
							}
						}
						break;
					case '5': //财务
					// echo'111';
					// exit;
						$data['ctype'] = $ulist[0]['m_type'];
						$data['cname'] = $ulist[0]['user'];
						$data['ctime'] = date('Y-m-d');
						$look['look'] = '4';
						if (M('sh')->where(['sid'=>$sid])->save($data) > 0) {
							if (M('look')->where(['id'=>$sid])->save($look) > 0) {
								echo '1111';
							}
						}
						break;

					case '9': //职能总经理
						$shlist = M('sh')->where(['sid'=>$sid])->select();
						// dump($shlist);
						// exit;
						if (empty($shlist[0]['cname'])) {
							$data['jtype'] = $ulist[0]['m_type'];
							$data['jname'] = $ulist[0]['user'];
							$data['jtime'] = date('Y-m-d');
							$look['look'] = '2';
							// dump($data);
							// exit;
							if (M('sh')->where(['sid'=>$sid])->save($data) > 0) {
								if (M('look')->where(['id'=>$sid])->save($look) > 0) {
									echo '1111';
								}
							}
						}else{
							$data['gtype'] = $ulist[0]['m_type'];
							$data['gname'] = $ulist[0]['user'];
							$data['gtime'] = date('Y-m-d');
							$look['look'] = '5';
							// dump($data);
							// exit;
							if (M('sh')->where(['sid'=>$sid])->save($data) > 0) {
								if (M('look')->where(['id'=>$sid])->save($look) > 0) {
									echo '1111';
								}
							}
						}
						
						break;
					case '8': //网络总经理
					
						$data['jtype'] = $ulist[0]['m_type'];
						$data['jname'] = $ulist[0]['user'];
						$data['jtime'] = date('Y-m-d');
						$look['look'] = '2';
						// dump($data);
						// exit;
						if (M('sh')->where(['sid'=>$sid])->save($data) > 0) {
							if (M('look')->where(['id'=>$sid])->save($look) > 0) {
								echo '1111';
							}
						}
						break;

					case '6': //董事办
					
						$data['dtype'] = $ulist[0]['m_type'];
						$data['dname'] = $ulist[0]['user'];
						$data['dtime'] = date('Y-m-d');
						$look['look'] = '6';
						// dump($data);
						// exit;
						if (M('sh')->where(['sid'=>$sid])->save($data) > 0) {
							if (M('look')->where(['id'=>$sid])->save($look) > 0) {
								echo '1111';
							}
						}
						break;

					
				}
				break;
			case '2':  //固定资产
				$sid = $_POST['id'];
				$slist = M('look')->where(['id'=>$sid])->select();//查询申请物资信息
				$ulist = M('member')->where(['uid'=>$_SESSION['uid']])->select();
				$alist = M('auth_group_access')->where(['uid'=>$_SESSION['uid']])->select();
				$glist = M('auth_group')->where(['id'=>$alist[0]['group_id']])->select();
				$data['sid'] = $sid;
				$data['stype'] = '1';
				$data['wtype'] = '固定资产申购';
				switch ($ulist[0]['m_type']) {
					case '2': //主管
						
						$data['ztype'] = $ulist[0]['m_type'];
						$data['zname'] = $ulist[0]['user'];
						$data['ztime'] = date('Y-m-d');
						$look['look'] = '1';
						if (M('sh')->add($data) > 0) {
							if (M('look')->where(['id'=>$sid])->save($look) > 0) {
								echo '1111';
							}
						}
						break;
					case '3': //经理
						switch ($glist[0]['post']) {
							case '行政中心':
								$ylist = M('sh')->where(['sid'=>$sid])->find();
								
								if (empty($ylist['jname'])) {
									$data['jtype'] = $ulist[0]['m_type'];
									$data['jname'] = $ulist[0]['user'];
									$data['jtime'] = date('Y-m-d');
									$look['look'] = '2';
									if (M('sh')->where(['sid'=>$sid])->save($data) > 0) {
										if (M('look')->where(['id'=>$sid])->save($look) > 0) {
											echo '1111';
										}
									}
								}else{
									$data['xtype'] = $ulist[0]['m_type'];
									$data['xname'] = $ulist[0]['user'];
									$data['xtime'] = date('Y-m-d');
									$look['look'] = '3';
									if (M('sh')->where(['sid'=>$sid])->save($data) > 0) {
										if (M('look')->where(['id'=>$sid])->save($look) > 0) {
											echo '1111';
										}
									}
								}
								break;
							case '采购中心':
								$data['jtype'] = $ulist[0]['m_type'];
								$data['jname'] = $ulist[0]['user'];
								$data['jtime'] = date('Y-m-d');
								$look['look'] = '2';
								if (M('sh')->where(['sid'=>$sid])->save($data) > 0) {
									if (M('look')->where(['id'=>$sid])->save($look) > 0) {
										echo '1111';
									}
								}
								break;
							case '财务中心':
								$ylist = M('sh')->where(['sid'=>$sid])->find();
								
								if (empty($ylist['jname'])) {
									$data['jtype'] = $ulist[0]['m_type'];
									$data['jname'] = $ulist[0]['user'];
									$data['jtime'] = date('Y-m-d');
									$look['look'] = '2';
									if (M('sh')->where(['sid'=>$sid])->save($data) > 0) {
										if (M('look')->where(['id'=>$sid])->save($look) > 0) {
											echo '1111';
										}
									}
								}else{
									$data['ctype'] = $ulist[0]['m_type'];
									$data['cname'] = $ulist[0]['user'];
									$data['ctime'] = date('Y-m-d');
									$look['look'] = '4';
									if (M('sh')->where(['sid'=>$sid])->save($data) > 0) {
										if (M('look')->where(['id'=>$sid])->save($look) > 0) {
											echo '1111';
										}
									}
								}
								break;
							
						}
					
						break;

					case '4': //行政
					// echo'111';
					// exit;
						$data['xtype'] = $ulist[0]['m_type'];
						$data['xname'] = $ulist[0]['user'];
						$data['xtime'] = date('Y-m-d');
						$look['look'] = '3';
						if (M('sh')->where(['sid'=>$sid])->save($data) > 0) {
							if (M('look')->where(['id'=>$sid])->save($look) > 0) {
								echo '1111';
							}
						}
						break;
					case '5': //财务
					// echo'111';
					// exit;
						$data['ctype'] = $ulist[0]['m_type'];
						$data['cname'] = $ulist[0]['user'];
						$data['ctime'] = date('Y-m-d');
						$look['look'] = '4';
						if (M('sh')->where(['sid'=>$sid])->save($data) > 0) {
							if (M('look')->where(['id'=>$sid])->save($look) > 0) {
								echo '1111';
							}
						}
						break;

					case '9': //职能总经理
						$shlist = M('sh')->where(['sid'=>$sid])->select();
						// dump($shlist);
						// exit;
						if (empty($shlist[0]['cname'])) {
							$data['jtype'] = $ulist[0]['m_type'];
							$data['jname'] = $ulist[0]['user'];
							$data['jtime'] = date('Y-m-d');
							$look['look'] = '2';
							// dump($data);
							// exit;
							if (M('sh')->where(['sid'=>$sid])->save($data) > 0) {
								if (M('look')->where(['id'=>$sid])->save($look) > 0) {
									echo '1111';
								}
							}
						}else{
							$data['gtype'] = $ulist[0]['m_type'];
							$data['gname'] = $ulist[0]['user'];
							$data['gtime'] = date('Y-m-d');
							$look['look'] = '5';
							// dump($data);
							// exit;
							if (M('sh')->where(['sid'=>$sid])->save($data) > 0) {
								if (M('look')->where(['id'=>$sid])->save($look) > 0) {
									echo '1111';
								}
							}
						}
						
						break;
					case '8': //网络总经理
					
						$data['jtype'] = $ulist[0]['m_type'];
						$data['jname'] = $ulist[0]['user'];
						$data['jtime'] = date('Y-m-d');
						$look['look'] = '2';
						// dump($data);
						// exit;
						if (M('sh')->where(['sid'=>$sid])->save($data) > 0) {
							if (M('look')->where(['id'=>$sid])->save($look) > 0) {
								echo '1111';
							}
						}
						break;

					case '6': //董事办
					
						$data['dtype'] = $ulist[0]['m_type'];
						$data['dname'] = $ulist[0]['user'];
						$data['dtime'] = date('Y-m-d');
						$look['look'] = '6';
						// dump($data);
						// exit;
						if (M('sh')->where(['sid'=>$sid])->save($data) > 0) {
							if (M('look')->where(['id'=>$sid])->save($look) > 0) {
								echo '1111';
							}
						}
						break;

					
				}
				break;
			case '0':  //行政物资
				$sid = $_POST['id'];
				$slist = M('look')->where(['id'=>$sid])->select();//查询申请物资信息
				$ulist = M('member')->where(['uid'=>$_SESSION['uid']])->select();
				$alist = M('auth_group_access')->where(['uid'=>$_SESSION['uid']])->select();
				$glist = M('auth_group')->where(['id'=>$alist[0]['group_id']])->select();
				$data['sid'] = $sid;
				$data['stype'] = '1';
				$data['wtype'] = '行政物品申购';
				switch ($ulist[0]['m_type']) {
					case '2': //主管
						
						$data['ztype'] = $ulist[0]['m_type'];
						$data['zname'] = $ulist[0]['user'];
						$data['ztime'] = date('Y-m-d');
						$look['look'] = '1';
						if (M('sh')->add($data) > 0) {
							if (M('look')->where(['id'=>$sid])->save($look) > 0) {
								echo '1111';
							}
						}
						break;
					case '3': //总经理
						switch ($glist[0]['post']) {
							case '行政中心':
								$arr['xtype'] = $ulist[0]['m_type'];
								$arr['xname'] = $ulist[0]['user'];
								$arr['xtime'] = date('Y-m-d');
								$look['look'] = '3';
								if (M('sh')->where(['sid'=>$sid])->save($arr) > 0) {
									if (M('look')->where(['id'=>$sid])->save($look) > 0) {
										echo '1111';
									}
								}
								break;
							case '采购中心':
								$arr['jtype'] = $ulist[0]['m_type'];
								$arr['jname'] = $ulist[0]['user'];
								$arr['jtime'] = date('Y-m-d');
								$look['look'] = '2';
								if (M('sh')->where(['sid'=>$sid])->save($arr) > 0) {
									if (M('look')->where(['id'=>$sid])->save($look) > 0) {
										echo '1111';
									}
								}
								break;
							case '财务中心':
								$arr['jtype'] = $ulist[0]['m_type'];
								$arr['jname'] = $ulist[0]['user'];
								$arr['jtime'] = date('Y-m-d');
								$look['look'] = '2';
								if (M('sh')->where(['sid'=>$sid])->save($arr) > 0) {
									if (M('look')->where(['id'=>$sid])->save($look) > 0) {
										echo '1111';
									}
								}
								break;
							
						}
					
						break;

					case '4': //行政
					// echo'111';
					// exit;
						$arr['xtype'] = $ulist[0]['m_type'];
						$arr['xname'] = $ulist[0]['user'];
						$arr['xtime'] = date('Y-m-d');
						$look['look'] = '3';
						if (M('sh')->where(['sid'=>$sid])->save($arr) > 0) {
							if (M('look')->where(['id'=>$sid])->save($look) > 0) {
								echo '1111';
							}
						}
						break;

					case '9': //职能总经理
						
						$shlist = M('sh')->where(['sid'=>$sid])->select();
						// dump($shlist);
						// exit;
						if (empty($shlist[0]['cname'])) {
							$data['jtype'] = $ulist[0]['m_type'];
							$data['jname'] = $ulist[0]['user'];
							$data['jtime'] = date('Y-m-d');
							$look['look'] = '2';
							// dump($data);
							// exit;
							if (M('sh')->where(['sid'=>$sid])->save($data) > 0) {
								if (M('look')->where(['id'=>$sid])->save($look) > 0) {
									echo '1111';
								}
							}
						}else{
							$data['gtype'] = $ulist[0]['m_type'];
							$data['gname'] = $ulist[0]['user'];
							$data['gtime'] = date('Y-m-d');
							$look['look'] = '4';
							// dump($data);
							// exit;
							if (M('sh')->where(['sid'=>$sid])->save($data) > 0) {
								if (M('look')->where(['id'=>$sid])->save($look) > 0) {
									echo '1111';
								}
							}
						}
						break;
					case '8': //职能总经理
					
						$arr['jtype'] = $ulist[0]['m_type'];
						$arr['jname'] = $ulist[0]['user'];
						$arr['jtime'] = date('Y-m-d');
						$look['look'] = '2';
						// dump($arr);
						// exit;
						if (M('sh')->where(['sid'=>$sid])->save($arr) > 0) {
							if (M('look')->where(['id'=>$sid])->save($look) > 0) {
								echo '1111';
							}
						}
						break;

					case '6': //董事办
					
						$arr['dtype'] = $ulist[0]['m_type'];
						$arr['dname'] = $ulist[0]['user'];
						$arr['dtime'] = date('Y-m-d');
						$look['look'] = '5';
						// dump($arr);
						// exit;
						if (M('sh')->where(['sid'=>$sid])->save($arr) > 0) {
							if (M('look')->where(['id'=>$sid])->save($look) > 0) {
								echo '1111';
							}
						}
						break;

					
				}
				break;
			
			
		}
		
		
		
	}


	//办公领用  //  急性需求  //固定资产 单项拒绝操作
	public function bju()
	{
		// dump(I());
		// exit;
		

		$ulist = M('member')->where(['uid'=>$_SESSION['uid']])->select();
		$alist = M('auth_group_access')->where(['uid'=>$_SESSION['uid']])->select();
		$glist = M('auth_group')->where(['id'=>$alist[0]['group_id']])->select();
		$llist = M('look')->where(['id'=>$_POST['id']])->find();
		$data['stype'] = '2';
		$data['cent'] = $_POST['cent'];
		$type = $_POST['type'];
		// dump(I());
		// exit;
		switch ($_POST['type']) {
			case '1':
				$data['wtype'] = '急性物品需求';
				break;
			case '2':
				$data['wtype'] = '固定资产物资';
				break;
			case '0':
				$data['wtype'] = '办公用品领用';
				break;
		}
		// dump($llist);
		// exit;
		switch ($type) {
			case '1':  //急性需求审批单个拒绝
					switch ($ulist[0]['m_type']) {
							case '2':  //主管
								$data['ztype'] = $ulist[0]['m_type'];
										
								$data['zname'] = $ulist[0]['user'];
								$data['ztime'] = date('Y-m-d');
								$data['sid'] = $_POST['id'];
								$data['cent'] = $_POST['cent'];
								// $data['stype'] = '2';
								$look['ju'] = '1';
												// dump($data);

								if (M('sh')->add($data) > 0) {
									if (M('look')->where(['id'=>$_POST['id']])->save($look) > 0) {
										echo '1111';
									}
								}
								break;
							case '3': //经理/总监
										switch ($glist[0]['post']) {
											case '行政中心':
												// $sid = $_POST['id'];	
												$ylist = M('sh')->where(['sid'=>$_POST['id']])->find();
												// dump($ylist);
												// exit;
												if (empty($ylist['jname'])) {
													$data['jtype'] = $ulist[0]['m_type'];
													$data['jname'] = $ulist[0]['user'];
													$data['jtime'] = date('Y-m-d');
													$look['ju'] = '2';
													if (M('sh')->where(['sid'=>$_POST['id']])->save($data) > 0) {
														if (M('look')->where(['id'=>$_POST['id']])->save($look) > 0) {
															echo '1111';
														}
													}
												}else{
													$data['xtype'] = $ulist[0]['m_type'];
													$data['xname'] = $ulist[0]['user'];
													$data['xtime'] = date('Y-m-d');
													$look['ju'] = '3';
													if (M('sh')->where(['sid'=>$_POST['id']])->save($data) > 0) {
														if (M('look')->where(['id'=>$_POST['id']])->save($look) > 0) {
															echo '1111';
														}
													}
												}
												
												break;
											case '采购中心':
												$data['jtype'] = $ulist[0]['m_type'];
												$data['jname'] = $ulist[0]['user'];
												$data['jtime'] = date('Y-m-d');
												$look['ju'] = '2';
												if (M('sh')->where(['sid'=>$_POST['id']])->save($data) > 0) {
													if (M('look')->where(['id'=>$_POST['id']])->save($look) > 0) {
														echo '1111';
													}
												}
												break;
											case '财务中心':
													$ylist = M('sh')->where(['sid'=>$_POST['id']])->find();
													if (empty($ylist['jname'])) {
														$data['jtype'] = $ulist[0]['m_type'];
														$data['jname'] = $ulist[0]['user'];
														$data['jtime'] = date('Y-m-d');
														$look['ju'] = '2';
														if (M('sh')->where(['sid'=>$_POST['id']])->save($data) > 0) {
															if (M('look')->where(['id'=>$_POST['id']])->save($look) > 0) {
																echo '1111';
															}
														}
													}else{
														$data['ctype'] = $ulist[0]['m_type'];
														$data['cname'] = $ulist[0]['user'];
														$data['ctime'] = date('Y-m-d');
														$look['ju'] = '4';
														if (M('sh')->where(['sid'=>$_POST['id']])->save($data) > 0) {
															if (M('look')->where(['id'=>$_POST['id']])->save($look) > 0) {
																echo '1111';
															}
														}
													}
													
												
												break;
											
										}

										break;
							case '4':  //行政
								$data['xtype'] = $ulist[0]['m_type'];
										
								$data['xname'] = $ulist[0]['user'];
								$data['xtime'] = date('Y-m-d');
								$data['sid'] = $_POST['id'];
								$data['cent'] = $_POST['cent'];
								// $data['stype'] = '2';
								$look['ju'] = '3';
												// dump($data);
												// exit;
								if (M('sh')->where(['sid'=>$_POST['id']])->save($data) > 0) {
									if (M('look')->where(['id'=>$_POST['id']])->save($look) > 0) {
										echo '1111';
									}
								}
								break;
							case '5':  //财务
								$data['ctype'] = $ulist[0]['m_type'];
										
								$data['cname'] = $ulist[0]['user'];
								$data['ctime'] = date('Y-m-d');
								$data['sid'] = $_POST['id'];
								$data['cent'] = $_POST['cent'];
								// $data['stype'] = '2';
								$look['ju'] = '4';
												// dump($data);
												// exit;
								if (M('sh')->where(['sid'=>$_POST['id']])->save($data) > 0) {
									if (M('look')->where(['id'=>$_POST['id']])->save($look) > 0) {
										echo '1111';
									}
								}
								break;
							case '9':  //职能总经理
								$ylist = M('sh')->where(['sid'=>$_POST['id']])->find();
								// dump($_POST['id']);
								// exit;
								if (empty($ylist['jname'])) {
									$data['jtype'] = $ulist[0]['m_type'];
									$data['jname'] = $ulist[0]['user'];
									$data['jtime'] = date('Y-m-d');
									$look['ju'] = '2';
													// dump($data);

									if (M('sh')->where(['sid'=>$_POST['id']])->save($data) > 0) {
										if (M('look')->where(['id'=>$_POST['id']])->save($look) > 0) {
											echo '1111';
										}
									}
								}else{
									$data['gtype'] = $ulist[0]['m_type'];
									$data['gname'] = $ulist[0]['user'];
									$data['gtime'] = date('Y-m-d');
									$look['ju'] = '5';
													// dump($data);

									if (M('sh')->where(['sid'=>$_POST['id']])->save($data) > 0) {
										if (M('look')->where(['id'=>$_POST['id']])->save($look) > 0) {
											echo '1111';
										}
									}
								}
								
								break;
							

								
						}
				break;




			case '2':  //固定资产审批单个拒绝
					switch ($ulist[0]['m_type']) {
							case '2':  //主管
								$data['ztype'] = $ulist[0]['m_type'];
										
								$data['zname'] = $ulist[0]['user'];
								$data['ztime'] = date('Y-m-d');
								$data['sid'] = $_POST['id'];
								$data['cent'] = $_POST['cent'];
								// $data['stype'] = '2';
								$look['ju'] = '1';
												// dump($data);

								if (M('sh')->add($data) > 0) {
									if (M('look')->where(['id'=>$_POST['id']])->save($look) > 0) {
										echo '1111';
									}
								}
								break;
							case '3': //经理/总监
										switch ($glist[0]['post']) {
											case '行政中心':
												// $sid = $_POST['id'];	
												$ylist = M('sh')->where(['sid'=>$_POST['id']])->find();
												// dump($ylist);
												// exit;
												if (empty($ylist['jname'])) {
													$data['jtype'] = $ulist[0]['m_type'];
													$data['jname'] = $ulist[0]['user'];
													$data['jtime'] = date('Y-m-d');
													$look['ju'] = '2';
													if (M('sh')->where(['sid'=>$_POST['id']])->save($data) > 0) {
														if (M('look')->where(['id'=>$_POST['id']])->save($look) > 0) {
															echo '1111';
														}
													}
												}else{
													$data['xtype'] = $ulist[0]['m_type'];
													$data['xname'] = $ulist[0]['user'];
													$data['xtime'] = date('Y-m-d');
													$look['ju'] = '3';
													if (M('sh')->where(['sid'=>$_POST['id']])->save($data) > 0) {
														if (M('look')->where(['id'=>$_POST['id']])->save($look) > 0) {
															echo '1111';
														}
													}
												}
												
												break;
											case '采购中心':
												$data['jtype'] = $ulist[0]['m_type'];
												$data['jname'] = $ulist[0]['user'];
												$data['jtime'] = date('Y-m-d');
												$look['ju'] = '2';
												if (M('sh')->where(['sid'=>$_POST['id']])->save($data) > 0) {
													if (M('look')->where(['id'=>$_POST['id']])->save($look) > 0) {
														echo '1111';
													}
												}
												break;
											case '财务中心':
													$ylist = M('sh')->where(['sid'=>$_POST['id']])->find();
													if (empty($ylist['jname'])) {
														$data['jtype'] = $ulist[0]['m_type'];
														$data['jname'] = $ulist[0]['user'];
														$data['jtime'] = date('Y-m-d');
														$look['ju'] = '2';
														if (M('sh')->where(['sid'=>$_POST['id']])->save($data) > 0) {
															if (M('look')->where(['id'=>$_POST['id']])->save($look) > 0) {
																echo '1111';
															}
														}
													}else{
														$data['ctype'] = $ulist[0]['m_type'];
														$data['cname'] = $ulist[0]['user'];
														$data['ctime'] = date('Y-m-d');
														$look['ju'] = '4';
														if (M('sh')->where(['sid'=>$_POST['id']])->save($data) > 0) {
															if (M('look')->where(['id'=>$_POST['id']])->save($look) > 0) {
																echo '1111';
															}
														}
													}
													
												
												break;
											
										}

										break;
							case '4':  //行政
								$data['xtype'] = $ulist[0]['m_type'];
										
								$data['xname'] = $ulist[0]['user'];
								$data['xtime'] = date('Y-m-d');
								$data['sid'] = $_POST['id'];
								$data['cent'] = $_POST['cent'];
								// $data['stype'] = '2';
								$look['ju'] = '3';
												// dump($data);
												// exit;
								if (M('sh')->where(['sid'=>$_POST['id']])->save($data) > 0) {
									if (M('look')->where(['id'=>$_POST['id']])->save($look) > 0) {
										echo '1111';
									}
								}
								break;
							case '5':  //财务
								$data['ctype'] = $ulist[0]['m_type'];
										
								$data['cname'] = $ulist[0]['user'];
								$data['ctime'] = date('Y-m-d');
								$data['sid'] = $_POST['id'];
								$data['cent'] = $_POST['cent'];
								// $data['stype'] = '2';
								$look['ju'] = '4';
												// dump($data);
												// exit;
								if (M('sh')->where(['sid'=>$_POST['id']])->save($data) > 0) {
									if (M('look')->where(['id'=>$_POST['id']])->save($look) > 0) {
										echo '1111';
									}
								}
								break;
							case '9':  //职能总经理
								$ylist = M('sh')->where(['sid'=>$_POST['id']])->find();
								// dump($_POST['id']);
								// exit;
								if (empty($ylist['jname'])) {
									$data['jtype'] = $ulist[0]['m_type'];
									$data['jname'] = $ulist[0]['user'];
									$data['jtime'] = date('Y-m-d');
									$look['ju'] = '2';
													// dump($data);

									if (M('sh')->where(['sid'=>$_POST['id']])->save($data) > 0) {
										if (M('look')->where(['id'=>$_POST['id']])->save($look) > 0) {
											echo '1111';
										}
									}
								}else{
									$data['gtype'] = $ulist[0]['m_type'];
									$data['gname'] = $ulist[0]['user'];
									$data['gtime'] = date('Y-m-d');
									$look['ju'] = '5';
													// dump($data);

									if (M('sh')->where(['sid'=>$_POST['id']])->save($data) > 0) {
										if (M('look')->where(['id'=>$_POST['id']])->save($look) > 0) {
											echo '1111';
										}
									}
								}
								
								break;
							

								
						}
				break;
			case '0':  //办公领用审批单个拒绝
				switch ($ulist[0]['m_type']) {
							case '2':  //主管
								$data['ztype'] = $ulist[0]['m_type'];
										
								$data['zname'] = $ulist[0]['user'];
								$data['ztime'] = date('Y-m-d');
								$data['sid'] = $_POST['id'];
								$data['cent'] = $_POST['cent'];
								// $data['stype'] = '2';
								$look['ju'] = '1';
												// dump($data);

								if (M('sh')->add($data) > 0) {
									if (M('look')->where(['id'=>$_POST['id']])->save($look) > 0) {
										echo '1111';
									}
								}
								break;
							case '3': //经理/总监
										switch ($glist[0]['post']) {
											case '行政中心':
												// $sid = $_POST['id'];	
												$ylist = M('sh')->where(['sid'=>$_POST['id']])->find();
												// dump($ylist);
												// exit;
												if (empty($ylist['jname'])) {
													$data['jtype'] = $ulist[0]['m_type'];
													$data['jname'] = $ulist[0]['user'];
													$data['jtime'] = date('Y-m-d');
													$look['ju'] = '2';
													if (M('sh')->where(['sid'=>$_POST['id']])->save($data) > 0) {
														if (M('look')->where(['id'=>$_POST['id']])->save($look) > 0) {
															echo '1111';
														}
													}
												}else{
													$data['xtype'] = $ulist[0]['m_type'];
													$data['xname'] = $ulist[0]['user'];
													$data['xtime'] = date('Y-m-d');
													$look['ju'] = '3';
													if (M('sh')->where(['sid'=>$_POST['id']])->save($data) > 0) {
														if (M('look')->where(['id'=>$_POST['id']])->save($look) > 0) {
															echo '1111';
														}
													}
												}
												
												break;
											case '采购中心':
												$data['jtype'] = $ulist[0]['m_type'];
												$data['jname'] = $ulist[0]['user'];
												$data['jtime'] = date('Y-m-d');
												$look['ju'] = '2';
												if (M('sh')->where(['sid'=>$_POST['id']])->save($data) > 0) {
													if (M('look')->where(['id'=>$_POST['id']])->save($look) > 0) {
														echo '1111';
													}
												}
												break;
											case '财务中心':
													$ylist = M('sh')->where(['sid'=>$_POST['id']])->find();
													if (empty($ylist['jname'])) {
														$data['jtype'] = $ulist[0]['m_type'];
														$data['jname'] = $ulist[0]['user'];
														$data['jtime'] = date('Y-m-d');
														$look['ju'] = '2';
														if (M('sh')->where(['sid'=>$_POST['id']])->save($data) > 0) {
															if (M('look')->where(['id'=>$_POST['id']])->save($look) > 0) {
																echo '1111';
															}
														}
													}else{
														$data['ctype'] = $ulist[0]['m_type'];
														$data['cname'] = $ulist[0]['user'];
														$data['ctime'] = date('Y-m-d');
														$look['ju'] = '4';
														if (M('sh')->where(['sid'=>$_POST['id']])->save($data) > 0) {
															if (M('look')->where(['id'=>$_POST['id']])->save($look) > 0) {
																echo '1111';
															}
														}
													}
													
												
												break;
											
										}

										break;
							case '4':  //行政
								$data['xtype'] = $ulist[0]['m_type'];
										
								$data['xname'] = $ulist[0]['user'];
								$data['xtime'] = date('Y-m-d');
								$data['sid'] = $_POST['id'];
								$data['cent'] = $_POST['cent'];
								// $data['stype'] = '2';
								$look['ju'] = '3';
												// dump($data);
												// exit;
								if (M('sh')->where(['sid'=>$_POST['id']])->save($data) > 0) {
									if (M('look')->where(['id'=>$_POST['id']])->save($look) > 0) {
										echo '1111';
									}
								}
								break;
							
							case '9':  //职能总经理
								$ylist = M('sh')->where(['sid'=>$_POST['id']])->find();
								// dump($_POST['id']);
								// exit;
								if (empty($ylist['jname'])) {
									$data['jtype'] = $ulist[0]['m_type'];
									$data['jname'] = $ulist[0]['user'];
									$data['jtime'] = date('Y-m-d');
									$look['ju'] = '2';
													// dump($data);

									if (M('sh')->where(['sid'=>$_POST['id']])->save($data) > 0) {
										if (M('look')->where(['id'=>$_POST['id']])->save($look) > 0) {
											echo '1111';
										}
									}
								}else{
									$data['gtype'] = $ulist[0]['m_type'];
									$data['gname'] = $ulist[0]['user'];
									$data['gtime'] = date('Y-m-d');
									$look['ju'] = '5';
													// dump($data);

									if (M('sh')->where(['sid'=>$_POST['id']])->save($data) > 0) {
										if (M('look')->where(['id'=>$_POST['id']])->save($look) > 0) {
											echo '1111';
										}
									}
								}
								
								break;
							
							case '8':  //网络中心总经理
								
									$data['jtype'] = $ulist[0]['m_type'];
									$data['jname'] = $ulist[0]['user'];
									$data['jtime'] = date('Y-m-d');
									$look['ju'] = '2';
													// dump($data);

									if (M('sh')->where(['sid'=>$_POST['id']])->save($data) > 0) {
										if (M('look')->where(['id'=>$_POST['id']])->save($look) > 0) {
											echo '1111';
										}
									}
								
								
								break;
								
						}
				break;
		}
		
	}



	


	//办公领用/急性 一键拒绝操作
	public function bqju()
	  {
	    $llist = $_POST;
	    // dump($llist);
	    // exit;
	    if (empty($llist['uids'])) {
	      echo '3333';
	      exit;
	    }
	    $arr[] = $llist['uids'];

	    foreach ($arr as $k => $v) {
	      // dump();
	      // for ($i=0; $i <= $k ; $i++) { 
	      //  # code...
	      // }
	      // dump($v);
	      $ment[]= $v;
	      // $ment['cent']= $v['cent'];


	      
	    }
	    $data['cent'] = $_POST['cent'];
	    $ments = $ment[0];
	    // dump($cent);
	    // exit;
	    $data['stype'] = '2';

	    $ulist = M('member')->where(['uid'=>$_SESSION['uid']])->select();
	    $alist = M('auth_group_access')->where(['uid'=>$_SESSION['uid']])->select();
	    $glist = M('auth_group')->where(['id'=>$alist[0]['group_id']])->select();
	    switch ($_POST['ntype']) {
	    	case '1':  //急性物品审批一键拒绝
	    		switch ($ulist[0]['m_type']) {
				      case '3':  //经理
				        switch ($glist[0]['post']) {
				          case '行政中心':
				            $data['xtype'] = $ulist[0]['m_type'];
				            
				            $data['xname'] = $ulist[0]['user'];
				            $data['xtime'] = date('Y-m-d');
				            $look['ju'] = '3';
				                    // dump($data);

				            if (M('sh')->where(['sid'=>['in',$ments]])->save($data) > 0) {
				              if (M('look')->where(['id'=>['in',$ments]])->save($look) > 0) {
				                echo '1111';
				              }
				            }
				            
				            
				            break;
				          
				          case '财务中心':
				            $data['ctype'] = $ulist[0]['m_type'];
				            
				            $data['cname'] = $ulist[0]['user'];
				            $data['ctime'] = date('Y-m-d');
				            $look['ju'] = '4';
				                    // dump($data);

				            if (M('sh')->where(['sid'=>['in',$ments]])->save($data) > 0) {
				              if (M('look')->where(['id'=>['in',$ments]])->save($look) > 0) {
				                echo '1111';
				              }
				            }
				            break;
				          
				          
				        }
				        break;
				      case '4':  //行政
				        $data['xtype'] = $ulist[0]['m_type'];
				            
				        $data['xname'] = $ulist[0]['user'];
				        $data['xtime'] = date('Y-m-d');
				        $look['ju'] = '3';
				                // dump($ments);
				                // exit;

				        if (M('sh')->where(['sid'=>['in',$ments]])->save($data) > 0) {
				          if (M('look')->where(['id'=>['in',$ments]])->save($look) > 0) {
				            echo '1111';
				          }
				        }
				        break;
				      case '5':  //财务
				        $data['ctype'] = $ulist[0]['m_type'];
				            
				        $data['cname'] = $ulist[0]['user'];
				        $data['ctime'] = date('Y-m-d');
				        $look['ju'] = '4';
				                // dump($data);

				        if (M('sh')->where(['sid'=>['in',$ments]])->save($data) > 0) {
				          if (M('look')->where(['id'=>['in',$ments]])->save($look) > 0) {
				            echo '1111';
				          }
				        }
				        break;
				      case '9':  //职能总经理
				        $data['gtype'] = $ulist[0]['m_type'];
				            
				        $data['gname'] = $ulist[0]['user'];
				        $data['gtime'] = date('Y-m-d');
				        $look['ju'] = '5';
				                // dump($data);

				        if (M('sh')->where(['sid'=>['in',$ments]])->save($data) > 0) {
				          if (M('look')->where(['id'=>['in',$ments]])->save($look) > 0) {
				            echo '1111';
				          }
				        }
				        break;
				      case '6':  //职能总经理
				        $data['dtype'] = $ulist[0]['m_type'];
				            
				        $data['dname'] = $ulist[0]['user'];
				        $data['dtime'] = date('Y-m-d');
				        $look['ju'] = '6';
				                // dump($data);

				        if (M('sh')->where(['sid'=>['in',$ments]])->save($data) > 0) {
				          if (M('look')->where(['id'=>['in',$ments]])->save($look) > 0) {
				            echo '1111';
				          }
				        }
				        break;

				        
				    }
	    		break;
	    	case '2':  //固定资产审批一键拒绝
	    			switch ($ulist[0]['m_type']) {
				      case '3':  //经理
				        switch ($glist[0]['post']) {
				          case '行政中心':
				            $data['xtype'] = $ulist[0]['m_type'];
				            
				            $data['xname'] = $ulist[0]['user'];
				            $data['xtime'] = date('Y-m-d');
				            $look['ju'] = '3';
				                    // dump($data);

				            if (M('sh')->where(['sid'=>['in',$ments]])->save($data) > 0) {
				              if (M('look')->where(['id'=>['in',$ments]])->save($look) > 0) {
				                echo '1111';
				              }
				            }
				            
				            
				            break;
				          
				          case '财务中心':
				            $data['ctype'] = $ulist[0]['m_type'];
				            
				            $data['cname'] = $ulist[0]['user'];
				            $data['ctime'] = date('Y-m-d');
				            $look['ju'] = '4';
				                    // dump($data);

				            if (M('sh')->where(['sid'=>['in',$ments]])->save($data) > 0) {
				              if (M('look')->where(['id'=>['in',$ments]])->save($look) > 0) {
				                echo '1111';
				              }
				            }
				            break;
				          
				          
				        }
				        break;
				      case '4':  //行政
				        $data['xtype'] = $ulist[0]['m_type'];
				            
				        $data['xname'] = $ulist[0]['user'];
				        $data['xtime'] = date('Y-m-d');
				        $look['ju'] = '3';
				                // dump($ments);
				                // exit;

				        if (M('sh')->where(['sid'=>['in',$ments]])->save($data) > 0) {
				          if (M('look')->where(['id'=>['in',$ments]])->save($look) > 0) {
				            echo '1111';
				          }
				        }
				        break;
				      case '5':  //财务
				        $data['ctype'] = $ulist[0]['m_type'];
				            
				        $data['cname'] = $ulist[0]['user'];
				        $data['ctime'] = date('Y-m-d');
				        $look['ju'] = '4';
				                // dump($data);

				        if (M('sh')->where(['sid'=>['in',$ments]])->save($data) > 0) {
				          if (M('look')->where(['id'=>['in',$ments]])->save($look) > 0) {
				            echo '1111';
				          }
				        }
				        break;
				      case '9':  //职能总经理
				        $data['gtype'] = $ulist[0]['m_type'];
				            
				        $data['gname'] = $ulist[0]['user'];
				        $data['gtime'] = date('Y-m-d');
				        $look['ju'] = '5';
				                // dump($data);

				        if (M('sh')->where(['sid'=>['in',$ments]])->save($data) > 0) {
				          if (M('look')->where(['id'=>['in',$ments]])->save($look) > 0) {
				            echo '1111';
				          }
				        }
				        break;
				      case '6':  //职能总经理
				        $data['dtype'] = $ulist[0]['m_type'];
				            
				        $data['dname'] = $ulist[0]['user'];
				        $data['dtime'] = date('Y-m-d');
				        $look['ju'] = '6';
				                // dump($data);

				        if (M('sh')->where(['sid'=>['in',$ments]])->save($data) > 0) {
				          if (M('look')->where(['id'=>['in',$ments]])->save($look) > 0) {
				            echo '1111';
				          }
				        }
				        break;

				        
				    }
	    		break;
	    	case '0':  //办公用品领用审批一键拒绝
	    		# code...
	    		break;
	    }
	    



  }













	public function xju()
	{
		
		$sid = $_POST['id'];
	
		$slist = M('look')->where(['id'=>$sid])->select();//查询申请物资信息
		// $slist = M('look')->where(['id'=>$sid])->select();//查询申请物资信息
		$ulist = M('member')->where(['uid'=>$_SESSION['uid']])->select();
		$alist = M('auth_group_access')->where(['uid'=>$_SESSION['uid']])->select();
		$glist = M('auth_group')->where(['id'=>$alist[0]['group_id']])->select();

		if ($slist[0]['type'] == 1 || $slist[0]['type'] == 2) {
				// dump($slist);
				// exit;
				// $ulist = M('member')->join('oa_auth_group_access as t1 on t1.uid = oa_member.uid')->join('oa_auth_group as t2 on t2.id = t1.group_id')->where(['oa_member.uid'=>$_SESSION['uid']])->select();
				
				$ulist = M('member')->where(['uid'=>$_SESSION['uid']])->select();
				
				$data['sid'] = $sid;
				$data['stype'] = 2;
				$data['wtype'] = '急性物品申购';
				switch ($ulist[0]['m_type']) {
					case '2': //主管
						$data['ztype'] = $ulist[0]['m_type'];
						$data['zname'] = $ulist[0]['user'];
						$data['ztime'] = date('Y-m-d');
						$look['ju'] = '1';
						if (M('sh')->add($data) > 0) {
							if (M('look')->where(['id'=>$sid])->save($look) > 0) {
								echo '1111';
							}
						}
						break;
					case '3': //经理/总监
							
							
							switch ($glist[0]['post']) {
							case '行政中心':
								$ylist = M('sh')->where(['sid'=>$data['sid']])->find();
								if (empty($ylist['jname'])) {
									$data['jtype'] = $ulist[0]['m_type'];
									$data['jname'] = $ulist[0]['user'];
									$data['jtime'] = date('Y-m-d');
									$look['ju'] = '2';
									if (M('sh')->where(['sid'=>$sid])->save($data) > 0) {
										if (M('look')->where(['id'=>$sid])->save($look) > 0) {
											echo '1111';
										}
									}
								}else{
									$data['xtype'] = $ulist[0]['m_type'];
									$data['xname'] = $ulist[0]['user'];
									$data['xtime'] = date('Y-m-d');
									$look['ju'] = '3';
									if (M('sh')->where(['sid'=>$sid])->save($data) > 0) {
										if (M('look')->where(['id'=>$sid])->save($look) > 0) {
											echo '1111';
										}
									}
								}
								
								break;
							case '采购中心':
								$data['jtype'] = $ulist[0]['m_type'];
								$data['jname'] = $ulist[0]['user'];
								$data['jtime'] = date('Y-m-d');
								$look['ju'] = '2';
								if (M('sh')->where(['sid'=>$sid])->save($data) > 0) {
									if (M('look')->where(['id'=>$sid])->save($look) > 0) {
										echo '1111';
									}
								}
								break;
							case '财务中心':
								$ylist = M('sh')->where(['sid'=>$sid])->find();
								
								if (empty($ylist['jname'])) {
									$data['jtype'] = $ulist[0]['m_type'];
									$data['jname'] = $ulist[0]['user'];
									$data['jtime'] = date('Y-m-d');
									$look['ju'] = '2';
									if (M('sh')->where(['sid'=>$sid])->save($data) > 0) {
										if (M('look')->where(['id'=>$sid])->save($look) > 0) {
											echo '1111';
										}
									}
								}else{
									$data['ctype'] = $ulist[0]['m_type'];
									$data['cname'] = $ulist[0]['user'];
									$data['ctime'] = date('Y-m-d');
									$look['ju'] = '4';
									if (M('sh')->where(['sid'=>$sid])->save($data) > 0) {
										if (M('look')->where(['id'=>$sid])->save($look) > 0) {
											echo '1111';
										}
									}
								}
								break;
							
						}
					
						
						break;

					case '4': //行政
					// echo'111';
					// exit;
						$data['xtype'] = $ulist[0]['m_type'];
						$data['xname'] = $ulist[0]['user'];
						$data['xtime'] = date('Y-m-d');
						$look['ju'] = '3';
						if (M('sh')->where(['sid'=>$sid])->save($data) > 0) {
							if (M('look')->where(['id'=>$sid])->save($look) > 0) {
								echo '1111';
							}
						}
						break;
					case '5': //财务
					// echo'111';
					// exit;
						$data['ctype'] = $ulist[0]['m_type'];
						$data['cname'] = $ulist[0]['user'];
						$data['ctime'] = date('Y-m-d');
						$look['ju'] = '4';
						if (M('sh')->where(['sid'=>$sid])->save($data) > 0) {
							if (M('look')->where(['id'=>$sid])->save($look) > 0) {
								echo '1111';
							}
						}
						break;

					case '9': //职能总经理
						
						$slist = M('sh')->where(['sid'=>$sid])->select();
						// dump($slist);
						// exit;
						if (empty($slist[0]['cname'])) {
							$data['jtype'] = $ulist[0]['m_type'];
							$data['jname'] = $ulist[0]['user'];
							$data['jtime'] = date('Y-m-d');
							$look['ju'] = '2';
							if (M('sh')->where(['sid'=>$sid])->save($data) > 0) {
								if (M('look')->where(['id'=>$sid])->save($look) > 0) {
									echo '1111';
								}
							}
						}else{
							$data['gtype'] = $ulist[0]['m_type'];
							$data['gname'] = $ulist[0]['user'];
							$data['gtime'] = date('Y-m-d');
							$look['ju'] = '5';
							if (M('sh')->where(['sid'=>$sid])->save($data) > 0) {
								if (M('look')->where(['id'=>$sid])->save($look) > 0) {
									echo '1111';
								}
							}
						}
							
						
						break;
					case '8': //网络总经理	
							$data['jtype'] = $ulist[0]['m_type'];
							$data['jname'] = $ulist[0]['user'];
							$data['jtime'] = date('Y-m-d');
							$look['ju'] = '2';
							if (M('sh')->where(['sid'=>$sid])->save($data) > 0) {
								if (M('look')->where(['id'=>$sid])->save($look) > 0) {
									echo '1111';
								}
							}
						
						break;

					case '6': //董事办
					
						$data['dtype'] = $ulist[0]['m_type'];
						$data['dname'] = $ulist[0]['user'];
						$data['dtime'] = date('Y-m-d');
						$look['ju'] = '6';
						// dump($arr);
						// exit;
						if (M('sh')->where(['sid'=>$sid])->save($data) > 0) {
							if (M('look')->where(['id'=>$sid])->save($look) > 0) {
								echo '1111';
							}
						}
						break;

					
				}
		}else{ //以下为行政物资与固定物资拒绝
					switch ($slist[0]['type']) {
							case '0':
								$data['wtype'] = '行政物品申购';
								break;
							case '1':
								$data['wtype'] = '急性物品申购';
								break;
							case '2':
								$data['wtype'] = '固定资产申购';
								break;
						}
				// dump($slist);
				// exit;
				// $ulist = M('member')->join('oa_auth_group_access as t1 on t1.uid = oa_member.uid')->join('oa_auth_group as t2 on t2.id = t1.group_id')->where(['oa_member.uid'=>$_SESSION['uid']])->select();
				$sid = $_POST['id'];
				// echo $sid;
				// exit;

				$ulist = M('member')->where(['uid'=>$_SESSION['uid']])->select();
				
				$data['sid'] = $sid;
				$data['stype'] = 2;

				switch ($ulist[0]['m_type']) {
					case '2': //主管
						$data['ztype'] = $ulist[0]['m_type'];
						$data['zname'] = $ulist[0]['user'];
						$data['ztime'] = date('Y-m-d');
						$look['ju'] = '1';
						if (M('sh')->add($data) > 0) {
							if (M('look')->where(['id'=>$sid])->save($look) > 0) {
								echo '1111';
							}
						}
						break;
					case '3': //经理/总监
					// echo ' 111';
					// exit;
						switch ($glist[0]['post']) {
							case '行政中心':
								// $sid = $_POST['id'];	
								$ylist = M('sh')->where(['sid'=>$sid])->find();
								// dump($ylist);
								// exit;
								if (empty($ylist['jname'])) {
									$data['jtype'] = $ulist[0]['m_type'];
									$data['jname'] = $ulist[0]['user'];
									$data['jtime'] = date('Y-m-d');
									$look['ju'] = '2';
									if (M('sh')->where(['sid'=>$sid])->save($data) > 0) {
										if (M('look')->where(['id'=>$sid])->save($look) > 0) {
											echo '1111';
										}
									}
								}else{
									$data['xtype'] = $ulist[0]['m_type'];
									$data['xname'] = $ulist[0]['user'];
									$data['xtime'] = date('Y-m-d');
									$look['ju'] = '3';
									if (M('sh')->where(['sid'=>$sid])->save($data) > 0) {
										if (M('look')->where(['id'=>$sid])->save($look) > 0) {
											echo '1111';
										}
									}
								}
								
								break;
							case '采购中心':
								$data['jtype'] = $ulist[0]['m_type'];
								$data['jname'] = $ulist[0]['user'];
								$data['jtime'] = date('Y-m-d');
								$look['ju'] = '2';
								if (M('sh')->where(['sid'=>$sid])->save($data) > 0) {
									if (M('look')->where(['id'=>$sid])->save($look) > 0) {
										echo '1111';
									}
								}
								break;
							case '财务中心':
									$data['jtype'] = $ulist[0]['m_type'];
									$data['jname'] = $ulist[0]['user'];
									$data['jtime'] = date('Y-m-d');
									$look['ju'] = '2';
									if (M('sh')->where(['sid'=>$sid])->save($data) > 0) {
										if (M('look')->where(['id'=>$sid])->save($look) > 0) {
											echo '1111';
										}
									}
								
								break;
							
						}

						break;

					case '4': //行政
					// echo'111';
					// exit;
						$data['xtype'] = $ulist[0]['m_type'];
						$data['xname'] = $ulist[0]['user'];
						$data['xtime'] = date('Y-m-d');
						$look['ju'] = '3';
						if (M('sh')->where(['sid'=>$sid])->save($data) > 0) {
							if (M('look')->where(['id'=>$sid])->save($look) > 0) {
								echo '1111';
							}
						}
						break;

					case '9': //职能总经理
						
						// $slist = M('sh')->where(['sid'=>$sid])->select();
						// dump($slist);
						// exit;
							
							$data['jtype'] = $ulist[0]['m_type'];
							$data['jname'] = $ulist[0]['user'];
							$data['jtime'] = date('Y-m-d');
							$look['ju'] = '2';
							if (M('sh')->where(['sid'=>$sid])->save($data) > 0) {
								if (M('look')->where(['id'=>$sid])->save($look) > 0) {
									echo '1111';
								}
							}
						
						break;

					case '6': //董事办
					
						$data['dtype'] = $ulist[0]['m_type'];
						$data['dname'] = $ulist[0]['user'];
						$data['dtime'] = date('Y-m-d');
						$look['ju'] = '5';
						// dump($arr);
						// exit;
						if (M('sh')->where(['sid'=>$sid])->save($data) > 0) {
							if (M('look')->where(['id'=>$sid])->save($look) > 0) {
								echo '1111';
							}
						}
						break;

					
				}
		}
		
	}


	// public function fju()
	// {
		
	// 	$sid = $_POST['id'];
	// 	$slist = M('cost')->where(['id'=>$sid])->select();//查询申请物资信息
	// 	switch ($slist[0]['type']) {
	// 				case '1':
	// 					$data['wtype'] = '业务招待费';
	// 					break;
	// 				case '2':
	// 					$data['wtype'] = '药品耗材';
	// 					break;
	// 				case '3':
	// 					$data['wtype'] = '行政借款';
	// 					break;
	// 				case '4':
	// 					$data['wtype'] = '户外费用';
	// 					break;
	// 				case '5':
	// 					$data['wtype'] = '网络费用';
	// 					break;
	// 				case '6':
	// 					$data['wtype'] = '电视费用';
	// 					break;
	// 			}
	// 	// dump($slist);
	// 	// exit;
	// 	// $ulist = M('member')->join('oa_auth_group_access as t1 on t1.uid = oa_member.uid')->join('oa_auth_group as t2 on t2.id = t1.group_id')->where(['oa_member.uid'=>$_SESSION['uid']])->select();
		
	// 	$ulist = M('member')->where(['uid'=>$_SESSION['uid']])->select();
		
	// 	$data['sid'] = $sid;

	// 	switch ($ulist[0]['m_type']) {
	// 		case '2': //主管
	// 			$data['ztype'] = $ulist[0]['m_type'];
	// 			$data['zname'] = $ulist[0]['user'];
	// 			$data['ztime'] = date('Y-m-d');
	// 			$look['ju'] = '1';
	// 			if (M('sh')->add($data) > 0) {
	// 				if (M('cost')->where(['id'=>$sid])->save($look) > 0) {
	// 					echo '1111';
	// 				}
	// 			}
	// 			break;
	// 		case '3': //经理/总监
	// 			$arr['jtype'] = $ulist[0]['m_type'];
	// 			$arr['jname'] = $ulist[0]['user'];
	// 			$arr['jtime'] = date('Y-m-d');
	// 			$look['ju'] = '2';
	// 			if (M('sh')->where(['sid'=>$sid])->save($arr) > 0) {
	// 				if (M('cost')->where(['id'=>$sid])->save($look) > 0) {
	// 					echo '1111';
	// 				}
	// 			}
	// 			break;

	// 		case '4': //行政
	// 		// echo'111';
	// 		// exit;
	// 			$arr['xtype'] = $ulist[0]['m_type'];
	// 			$arr['xname'] = $ulist[0]['user'];
	// 			$arr['xtime'] = date('Y-m-d');
	// 			$look['ju'] = '3';
	// 			if (M('sh')->where(['sid'=>$sid])->save($arr) > 0) {
	// 				if (M('cost')->where(['id'=>$sid])->save($look) > 0) {
	// 					echo '1111';
	// 				}
	// 			}
	// 			break;

	// 		case '5': //财务
	// 			$arr['ctype'] = $ulist[0]['m_type'];
	// 			$arr['cname'] = $ulist[0]['user'];
	// 			$arr['ctime'] = date('Y-m-d');
	// 			$look['ju'] = '4';
	// 			if (M('sh')->where(['sid'=>$sid])->save($arr) > 0) {
	// 				if (M('cost')->where(['id'=>$sid])->save($look) > 0) {
	// 					echo '1111';
	// 				}
	// 			}
	// 			break;


	// 		case '6': //董事办
			
	// 			$arr['dtype'] = $ulist[0]['m_type'];
	// 			$arr['dname'] = $ulist[0]['user'];
	// 			$arr['dtime'] = date('Y-m-d');
	// 			$look['ju'] = '5';
	// 			// dump($arr);
	// 			// exit;
	// 			if (M('sh')->where(['sid'=>$sid])->save($arr) > 0) {
	// 				if (M('cost')->where(['id'=>$sid])->save($look) > 0) {
	// 					echo '1111';
	// 				}
	// 			}
	// 			break;

			
	// 	}
		
	// }


















	public function xiang()
	{
					// dump(I());
					// exit;
					$type = $_GET['type'];
					$gid = M('auth_group_access')->where(['uid'=>$_SESSION['uid']])->select();
					// dump($gid);
					// exit;
					$glist = M('auth_group')->where(['id'=>$gid[0]['group_id']])->select();
					// $title = substr($glist[0]['title'], 0,2);
					// dump($glist);
					// exit;
					$ulist = M('member')->where(['uid'=>$_SESSION['uid']])->select();
					// dump($ulist);
					// 		exit;
				
							switch ($type) {
								case '1':		//所有通过的行政类
										//判断权限;
										if ($glist[0]['title'] == '超级管理员' || $ulist[0]['m_type'] == '4' || $ulist[0]['m_type'] == '5' || $ulist[0]['m_type'] == '6') {
												// $x_list = M('look')->where(['look'=>5])->order('id DESC')->select();
												// $x_list = M('look')->join('oa_sh as t1 on t1.sid = oa_look.id')->where(['oa_look.look'=>'5'])->select();
												// dump($x_list);
												// exit;
												$count =  M('look')->join('oa_sh as t1 on t1.sid = oa_look.id')->where(['oa_look.look'=>'5'])->count();
										        // echo $count;
										        // exit;
										        $pagecount = 10;
										        $page = new \Think\Page($count , $pagecount);
										        // $row[] = '';
										        $page->parameter = $row; //此处的row是数组，为了传递查询条件
										        $page->setConfig('first');
										        $page->setConfig('prev','上一页');
										        $page->setConfig('next','下一页');
										        $page->setConfig('last','尾页');
										        $page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% 第 '.I('p',1).' 页/共 %TOTAL_PAGE% 页 ( '.$pagecount.' 条/页 共 %TOTAL_ROW% 条)');
										        $show = $page->show();
										        $list =  M('look')->join('oa_sh as t1 on t1.sid = oa_look.id')->where(['oa_look.look'=>'5'])->limit($page->firstRow.','.$page->listRows)->select();
										        $this->assign('x_list',$list);
										        $this->assign('page',$show);


												$lei = '1';
												$this->assign('lei',$lei);
												// $this->assign('x_list',$x_list);
												
												$this->display();
												exit;
										}


											$apost = $glist[0]['post'];
											// echo $apost;
											// exit;
												
											$count =  M('look')->join('oa_sh as t1 on t1.sid = oa_look.id')->where(['oa_look.look'=>'5','oa_look.ment'=>$apost])->count();
										      // echo $count;
										      // exit;
										      $pagecount = 10;
										      $page = new \Think\Page($count , $pagecount);
										      // $row[] = '';
										      $page->parameter = $row; //此处的row是数组，为了传递查询条件
										      $page->setConfig('first');
										      $page->setConfig('prev','上一页');
										      $page->setConfig('next','下一页');
										      $page->setConfig('last','尾页');
										      $page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% 第 '.I('p',1).' 页/共 %TOTAL_PAGE% 页 ( '.$pagecount.' 条/页 共 %TOTAL_ROW% 条)');
										      $show = $page->show();
										      $list =  M('look')->join('oa_sh as t1 on t1.sid = oa_look.id')->where(['oa_look.look'=>'5','oa_look.ment'=>$apost])->limit($page->firstRow.','.$page->listRows)->select();
										      $lei = '1';

										      $this->assign('x_list',$list);
										      $this->assign('lei',$lei);   //判断行政类, 费用类
										      $this->assign('page',$show);
										      $this->display();
												
								break;		      	


								case '2':   //所有通过的费用类
										
											//判断权限;
										if ($glist[0]['title'] == '超级管理员' || $ulist[0]['m_type'] == '4' || $ulist[0]['m_type'] == '5' || $ulist[0]['m_type'] == '6') {
												// $x_list = M('look')->where(['look'=>5])->order('id DESC')->select();
												// $x_list = M('look')->join('oa_sh as t1 on t1.sid = oa_look.id')->where(['oa_look.look'=>'5'])->select();
												// dump($x_list);
												// exit;
												$count =  M('cost')->join('oa_sh as t1 on t1.sid = oa_cost.id')->where(['oa_cost.look'=>'5'])->count();
										        // echo $count;
										        // exit;
										        $pagecount = 10;
										        $page = new \Think\Page($count , $pagecount);
										        // $row[] = '';
										        $page->parameter = $row; //此处的row是数组，为了传递查询条件
										        $page->setConfig('first');
										        $page->setConfig('prev','上一页');
										        $page->setConfig('next','下一页');
										        $page->setConfig('last','尾页');
										        $page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% 第 '.I('p',1).' 页/共 %TOTAL_PAGE% 页 ( '.$pagecount.' 条/页 共 %TOTAL_ROW% 条)');
										        $show = $page->show();
										        $list =  M('cost')->join('oa_sh as t1 on t1.sid = oa_cost.id')->where(['oa_cost.look'=>'5'])->limit($page->firstRow.','.$page->listRows)->select();
										        $this->assign('x_list',$list);
										        $this->assign('page',$show);


												$lei = '2';
												$this->assign('lei',$lei);
												// $this->assign('x_list',$x_list);
												// dump($list);
										  //     exit;
												$this->display();
												exit;
										}
											$apost = $glist[0]['post'];
											// echo $apost;
											// exit;
												
											$count =  M('cost')->join('oa_sh as t1 on t1.sid = oa_cost.id')->where(['oa_cost.look'=>'5','oa_cost.ment'=>$apost])->count();
										      // echo $count;
										      // exit;
										      $pagecount = 10;
										      $page = new \Think\Page($count , $pagecount);
										      // $row[] = '';
										      $page->parameter = $row; //此处的row是数组，为了传递查询条件
										      $page->setConfig('first');
										      $page->setConfig('prev','上一页');
										      $page->setConfig('next','下一页');
										      $page->setConfig('last','尾页');
										      $page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% 第 '.I('p',1).' 页/共 %TOTAL_PAGE% 页 ( '.$pagecount.' 条/页 共 %TOTAL_ROW% 条)');
										      $show = $page->show();
										      $list =  M('cost')->join('oa_sh as t1 on t1.sid = oa_cost.id')->where(['oa_cost.look'=>'5','oa_cost.ment'=>$apost])->limit($page->firstRow.','.$page->listRows)->select();
										      $lei = '2';

										      $this->assign('x_list',$list);
										      $this->assign('lei',$lei);
										      $this->assign('page',$show);
										      $this->display();
												
								break;
									


								case '3':   //拒绝行政类
											//判断权限;
										if ($glist[0]['title'] == '超级管理员' || $ulist[0]['m_type'] == '4' || $ulist[0]['m_type'] == '5' || $ulist[0]['m_type'] == '6') {
												// $x_list = M('look')->where(['look'=>5])->order('id DESC')->select();
												// $x_list = M('look')->join('oa_sh as t1 on t1.sid = oa_look.id')->where(['oa_look.look'=>'5'])->select();
												// dump($x_list);
												// exit;
												$count =  M('look')->join('oa_sh as t1 on t1.sid = oa_look.id')->where(['oa_look.ju'=>['neq',0]])->count();
										        // echo $count;
										        // exit;
										        $pagecount = 10;
										        $page = new \Think\Page($count , $pagecount);
										        // $row[] = '';
										        $page->parameter = $row; //此处的row是数组，为了传递查询条件
										        $page->setConfig('first');
										        $page->setConfig('prev','上一页');
										        $page->setConfig('next','下一页');
										        $page->setConfig('last','尾页');
										        $page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% 第 '.I('p',1).' 页/共 %TOTAL_PAGE% 页 ( '.$pagecount.' 条/页 共 %TOTAL_ROW% 条)');
										        $show = $page->show();
										        $list =  M('look')->join('oa_sh as t1 on t1.sid = oa_look.id')->where(['oa_look.ju'=>['neq',0]])->limit($page->firstRow.','.$page->listRows)->select();
										       
										        $this->assign('x_list',$list);
										        $this->assign('page',$show);
										        

										        
												$lei = '3';
												$this->assign('lei',$lei);
												// $this->assign('x_list',$x_list);
												
												$this->display();
												exit;
										}
										
											$apost = $glist[0]['post'];
											// echo $apost;
											// exit;
												
											$count =  M('look')->join('oa_sh as t1 on t1.sid = oa_look.id')->where(['oa_look.ju'=>['neq',0],'oa_look.ment'=>$apost])->count();
										      // echo $count;
										      // exit;
										      $pagecount = 10;
										      $page = new \Think\Page($count , $pagecount);
										      // $row[] = '';
										      $page->parameter = $row; //此处的row是数组，为了传递查询条件
										      $page->setConfig('first');
										      $page->setConfig('prev','上一页');
										      $page->setConfig('next','下一页');
										      $page->setConfig('last','尾页');
										      $page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% 第 '.I('p',1).' 页/共 %TOTAL_PAGE% 页 ( '.$pagecount.' 条/页 共 %TOTAL_ROW% 条)');
										      $show = $page->show();
										      $list = M('look')->join('oa_sh as t1 on t1.sid = oa_look.id')->where(['oa_look.ju'=>['neq',0],'oa_look.ment'=>$apost])->limit($page->firstRow.','.$page->listRows)->select();
										      $lei = '3';
										      
										      $this->assign('x_list',$list);
										      $this->assign('lei',$lei);
										      $this->assign('page',$show);
										      $this->display();
												
								break;






								case '4':   //拒绝费用类
											//判断权限;
										if ($glist[0]['title'] == '超级管理员' || $ulist[0]['m_type'] == '4' || $ulist[0]['m_type'] == '5' || $ulist[0]['m_type'] == '6') {
												// $x_list = M('look')->where(['look'=>5])->order('id DESC')->select();
												// $x_list = M('look')->join('oa_sh as t1 on t1.sid = oa_look.id')->where(['oa_look.look'=>'5'])->select();
												// dump($x_list);
												// exit;
												$count =  M('cost')->join('oa_sh as t1 on t1.sid = oa_cost.id')->where(['oa_cost.ju'=>['neq',0]])->count();
										        // echo $count;
										        // exit;
										        $pagecount = 10;
										        $page = new \Think\Page($count , $pagecount);
										        // $row[] = '';
										        $page->parameter = $row; //此处的row是数组，为了传递查询条件
										        $page->setConfig('first');
										        $page->setConfig('prev','上一页');
										        $page->setConfig('next','下一页');
										        $page->setConfig('last','尾页');
										        $page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% 第 '.I('p',1).' 页/共 %TOTAL_PAGE% 页 ( '.$pagecount.' 条/页 共 %TOTAL_ROW% 条)');
										        $show = $page->show();
										        $list =  M('cost')->join('oa_sh as t1 on t1.sid = oa_cost.id')->where(['oa_cost.ju'=>['neq',0]])->limit($page->firstRow.','.$page->listRows)->select();
										       // dump($list);
										       //  exit;
										        $this->assign('x_list',$list);
										        $this->assign('page',$show);
										        

										        
												$lei = '4';
												$this->assign('lei',$lei);
												// $this->assign('x_list',$x_list);
												
												$this->display();
												exit;
										}
										
											$apost = $glist[0]['post'];
											// echo $apost;
											// exit;
												
											$count =  M('cost')->join('oa_sh as t1 on t1.sid = oa_cost.id')->where(['oa_cost.ju'=>['neq',0],'oa_cost.ment'=>$apost])->count();
										      // echo $count;
										      // exit;
										      $pagecount = 10;
										      $page = new \Think\Page($count , $pagecount);
										      // $row[] = '';
										      $page->parameter = $row; //此处的row是数组，为了传递查询条件
										      $page->setConfig('first');
										      $page->setConfig('prev','上一页');
										      $page->setConfig('next','下一页');
										      $page->setConfig('last','尾页');
										      $page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% 第 '.I('p',1).' 页/共 %TOTAL_PAGE% 页 ( '.$pagecount.' 条/页 共 %TOTAL_ROW% 条)');
										      $show = $page->show();
										      $list = M('cost')->join('oa_sh as t1 on t1.sid = oa_cost.id')->where(['oa_cost.ju'=>['neq',0],'oa_cost.ment'=>$apost])->limit($page->firstRow.','.$page->listRows)->select();
										      $lei = '4';
										      
										      $this->assign('x_list',$list);
										      $this->assign('lei',$lei);
										      $this->assign('page',$show);
										      $this->display();
												
								break;




								





								
							}
					


		


		
	}









	public function qtong()
	{
		// dump(I());
		// exit;
		$llist = $_POST;
		foreach ($llist as $k => $v) {
			// dump();
			// for ($i=0; $i <= $k ; $i++) { 
			// 	# code...
			// }
			$ment[]= $v;

			
		}
		$ments = $ment[0];

		// $new= implode(',',$ments);
		// echo $new;
		// exit;
		// $arr = 'id='.$new;
		// // echo $arr;
		// // exit;
		// $llist = M('look')->where($arr)->select();
		// dump($ments);
		// exit;

		$ulist = M('member')->where(['uid'=>$_SESSION['uid']])->select();
		$alist = M('auth_group_access')->where(['uid'=>$_SESSION['uid']])->select();
		$glist = M('auth_group')->where(['id'=>$alist[0]['group_id']])->select();
		// $slist = M('look')->where(['id'=>['in',$ments]])->select();
		
		// dump($glist);
		// exit;
		// $data=[];
		$ltt = M('look')->where(['id'=>['in',$ments]])->select();
		$data['stype'] = 1;
		// dump($ltt);
		// exit;
		switch ($ltt[0]['type']) {
			case '1':  //急性物品申购
				$data['wtype'] = '急性物品申购';
				switch ($ulist[0]['m_type']) {
					case '2':  //主管
						$data['ztype'] = $ulist[0]['m_type'];
						
						$data['zname'] = $ulist[0]['user'];
						$data['ztime'] = date('Y-m-d');
						$look['look'] = '1';
						// dump($data);
						// exit;

				        $c = [];
				        foreach ($ments as $k => $v) {
				            $c[$k]['sid'] = $v;
				            $c[$k]['ztype'] = $data['ztype'];
				            $c[$k]['zname'] = $data['zname'];
				            $c[$k]['ztime'] = $data['ztime'];
				            $c[$k]['stype'] = $data['stype'];
				            $c[$k]['wtype'] = $data['wtype'];
				        }
				        // dump($c);
				        // exit;

						if (M('sh')->addAll($c) > 0) {
							if (M('look')->where(['id'=>['in',$ments]])->save($look) > 0) {
								echo '1111';
							}
						}
						break;
					case '3':  //经理
						switch ($glist[0]['post']) {
							case '行政中心':
								$ylist = M('sh')->where(['sid'=>$ments[0]])->select();
								if (empty($ylist[0]['jname'])) {
									$data['jtype'] = $ulist[0]['m_type'];
						
									$data['jname'] = $ulist[0]['user'];
									$data['jtime'] = date('Y-m-d');
									$look['look'] = '2';
									// dump($data);

									if (M('sh')->where(['sid'=>['in',$ments]])->save($data) > 0) {
										if (M('look')->where(['id'=>['in',$ments]])->save($look) > 0) {
											echo '1111';
										}
									}
								}else{
									$data['xtype'] = $ulist[0]['m_type'];
									$data['xname'] = $ulist[0]['user'];
									$data['xtime'] = date('Y-m-d');
									$look['look'] = '3';
									// dump($data);

									if (M('sh')->where(['sid'=>['in',$ments]])->save($data) > 0) {
										if (M('look')->where(['id'=>['in',$ments]])->save($look) > 0) {
											echo '1111';
										}
									}
								}
								break;

							case '采购中心':
								$data['jtype'] = $ulist[0]['m_type'];
						
								$data['jname'] = $ulist[0]['user'];
								$data['jtime'] = date('Y-m-d');
								$look['look'] = '2';
								// dump($data);

								if (M('sh')->where(['sid'=>['in',$ments]])->save($data) > 0) {
									if (M('look')->where(['id'=>['in',$ments]])->save($look) > 0) {
										echo '1111';
									}
								}
								break;
							case '财务中心':
										$ylist = M('sh')->where(['sid'=>$ments[0]])->select();
										if (empty($ylist[0]['jname'])) {
											$data['jtype'] = $ulist[0]['m_type'];
								
											$data['jname'] = $ulist[0]['user'];
											$data['jtime'] = date('Y-m-d');
											$look['look'] = '2';
											// dump($data);

											if (M('sh')->where(['sid'=>['in',$ments]])->save($data) > 0) {
												if (M('look')->where(['id'=>['in',$ments]])->save($look) > 0) {
													echo '1111';
												}
											}
										}else{
											$data['ctype'] = $ulist[0]['m_type'];
											$data['cname'] = $ulist[0]['user'];
											$data['ctime'] = date('Y-m-d');
											$look['look'] = '4';
											// dump($data);

											if (M('sh')->where(['sid'=>['in',$ments]])->save($data) > 0) {
												if (M('look')->where(['id'=>['in',$ments]])->save($look) > 0) {
													echo '1111';
												}
											}
										}
								break;
							
						}
					
						break;



					case '4':  //行政
							$data['xtype'] = $ulist[0]['m_type'];
							
							$data['xname'] = $ulist[0]['user'];
							$data['xtime'] = date('Y-m-d');
							$look['look'] = '3';
						// dump($data);
						// exit;

						if (M('sh')->where(['sid'=>['in',$ments]])->save($data) > 0) {
							if (M('look')->where(['id'=>['in',$ments]])->save($look) > 0) {
								echo '1111';
							}
						}
						break;
					case '5':  //财务
						$data['ctype'] = $ulist[0]['m_type'];
						
						$data['cname'] = $ulist[0]['user'];
						$data['ctime'] = date('Y-m-d');
						$look['look'] = '4';
						// dump($data);

						if (M('sh')->where(['sid'=>['in',$ments]])->save($data) > 0) {
							if (M('look')->where(['id'=>['in',$ments]])->save($look) > 0) {
								echo '1111';
							}
						}
						break;
					case '9':  //职能部门经理
					// echo '555';
					// exit;
						$cai = M('sh')->where(['sid'=>['in',$ments]])->select();
						// dump($cai);
						// exit;
							if (empty($cai[0]['cname'])) {
								$data['jtype'] = $ulist[0]['m_type'];
						
								$data['jname'] = $ulist[0]['user'];
								$data['jtime'] = date('Y-m-d');
								$look['look'] = '2';
								// dump($ments);
								// exit;

								if (M('sh')->where(['sid'=>['in',$ments]])->save($data) > 0) {
									if (M('look')->where(['id'=>['in',$ments]])->save($look) > 0) {
										echo '1111';
									}
								}
							}else{
								$data['gtype'] = $ulist[0]['m_type'];
						
								$data['gname'] = $ulist[0]['user'];
								$data['gtime'] = date('Y-m-d');
								$look['look'] = '5';
								// dump($data);

								if (M('sh')->where(['sid'=>['in',$ments]])->save($data) > 0) {
									if (M('look')->where(['id'=>['in',$ments]])->save($look) > 0) {
										echo '1111';
									}
								}
							}
						
						
						break;
					case '8':  //网络中心经理
						$data['jtype'] = $ulist[0]['m_type'];
						
						$data['jname'] = $ulist[0]['user'];
						$data['jtime'] = date('Y-m-d');
						$look['look'] = '2';
						// dump($data);

						if (M('sh')->where(['sid'=>['in',$ments]])->save($data) > 0) {
							if (M('look')->where(['id'=>['in',$ments]])->save($look) > 0) {
								echo '1111';
							}
						}
						break;

					case '6':  //董事办
						$data['dtype'] = $ulist[0]['m_type'];
						
						$data['dname'] = $ulist[0]['user'];
						$data['dtime'] = date('Y-m-d');
						$look['look'] = '6';
						// dump($data);

						if (M('sh')->where(['sid'=>['in',$ments]])->save($data) > 0) {
							if (M('look')->where(['id'=>['in',$ments]])->save($look) > 0) {
								echo '1111';
							}
						}
						break;
				}
				break;
			case '2':  //固定物品申购
					$data['wtype'] = '固定物品申购';
					switch ($ulist[0]['m_type']) {
						case '2':  //主管
							$data['ztype'] = $ulist[0]['m_type'];
							
							$data['zname'] = $ulist[0]['user'];
							$data['ztime'] = date('Y-m-d');
							$look['look'] = '1';
							// dump($data);
							// exit;

					        $c = [];
					        foreach ($ments as $k => $v) {
					            $c[$k]['sid'] = $v;
					            $c[$k]['ztype'] = $data['ztype'];
					            $c[$k]['zname'] = $data['zname'];
					            $c[$k]['ztime'] = $data['ztime'];
					            $c[$k]['stype'] = $data['stype'];
					            $c[$k]['wtype'] = $data['wtype'];
					        }
					        // dump($c);
					        // exit;

							if (M('sh')->addAll($c) > 0) {
								if (M('look')->where(['id'=>['in',$ments]])->save($look) > 0) {
									echo '1111';
								}
							}
							break;
						case '3':  //经理
							switch ($glist[0]['post']) {
								case '行政中心':
									
										$ylist = M('sh')->where(['sid'=>$ments[0]])->select();
										if (empty($ylist[0]['jname'])) {
											$data['jtype'] = $ulist[0]['m_type'];
								
											$data['jname'] = $ulist[0]['user'];
											$data['jtime'] = date('Y-m-d');
											$look['look'] = '2';
											// dump($data);

											if (M('sh')->where(['sid'=>['in',$ments]])->save($data) > 0) {
												if (M('look')->where(['id'=>['in',$ments]])->save($look) > 0) {
													echo '1111';
												}
											}
										}else{
											$data['xtype'] = $ulist[0]['m_type'];
											$data['xname'] = $ulist[0]['user'];
											$data['xtime'] = date('Y-m-d');
											$look['look'] = '3';
											// dump($data);

											if (M('sh')->where(['sid'=>['in',$ments]])->save($data) > 0) {
												if (M('look')->where(['id'=>['in',$ments]])->save($look) > 0) {
													echo '1111';
												}
											}
										}
									break;

								case '采购中心':
									$data['jtype'] = $ulist[0]['m_type'];
							
									$data['jname'] = $ulist[0]['user'];
									$data['jtime'] = date('Y-m-d');
									$look['look'] = '2';
									// dump($data);

									if (M('sh')->where(['sid'=>['in',$ments]])->save($data) > 0) {
										if (M('look')->where(['id'=>['in',$ments]])->save($look) > 0) {
											echo '1111';
										}
									}
									break;
								case '财务中心':
										$ylist = M('sh')->where(['sid'=>$ments[0]])->select();
										if (empty($ylist[0]['jname'])) {
											$data['jtype'] = $ulist[0]['m_type'];
								
											$data['jname'] = $ulist[0]['user'];
											$data['jtime'] = date('Y-m-d');
											$look['look'] = '2';
											// dump($data);

											if (M('sh')->where(['sid'=>['in',$ments]])->save($data) > 0) {
												if (M('look')->where(['id'=>['in',$ments]])->save($look) > 0) {
													echo '1111';
												}
											}
										}else{
											$data['ctype'] = $ulist[0]['m_type'];
											$data['cname'] = $ulist[0]['user'];
											$data['ctime'] = date('Y-m-d');
											$look['look'] = '4';
											// dump($data);

											if (M('sh')->where(['sid'=>['in',$ments]])->save($data) > 0) {
												if (M('look')->where(['id'=>['in',$ments]])->save($look) > 0) {
													echo '1111';
												}
											}
										}
									break;
								
							}
						
							break;



						case '4':  //行政
							$data['xtype'] = $ulist[0]['m_type'];
							
							$data['xname'] = $ulist[0]['user'];
							$data['xtime'] = date('Y-m-d');
							$look['look'] = '3';
							// dump($data);

							if (M('sh')->where(['sid'=>['in',$ments]])->save($data) > 0) {
								if (M('look')->where(['id'=>['in',$ments]])->save($look) > 0) {
									echo '1111';
								}
							}
							break;
						case '5':  //财务
							$data['ctype'] = $ulist[0]['m_type'];
							
							$data['cname'] = $ulist[0]['user'];
							$data['ctime'] = date('Y-m-d');
							$look['look'] = '4';
							// dump($data);

							if (M('sh')->where(['sid'=>['in',$ments]])->save($data) > 0) {
								if (M('look')->where(['id'=>['in',$ments]])->save($look) > 0) {
									echo '1111';
								}
							}
							break;
						case '9':  //职能部门经理
							$cai = M('sh')->where(['sid'=>['in',$ments]])->select();
								if (empty($cai[0]['cname'])) {
									$data['jtype'] = $ulist[0]['m_type'];
							
									$data['jname'] = $ulist[0]['user'];
									$data['jtime'] = date('Y-m-d');
									$look['look'] = '2';
									// dump($ments);
									// exit;

									if (M('sh')->where(['sid'=>['in',$ments]])->save($data) > 0) {
										if (M('look')->where(['id'=>['in',$ments]])->save($look) > 0) {
											echo '1111';
										}
									}
								}else{
									$data['gtype'] = $ulist[0]['m_type'];
							
									$data['gname'] = $ulist[0]['user'];
									$data['gtime'] = date('Y-m-d');
									$look['look'] = '5';
									// dump($data);

									if (M('sh')->where(['sid'=>['in',$ments]])->save($data) > 0) {
										if (M('look')->where(['id'=>['in',$ments]])->save($look) > 0) {
											echo '1111';
										}
									}
								}
							
							
							break;
						case '8':  //网络中心经理
							$data['jtype'] = $ulist[0]['m_type'];
							
							$data['jname'] = $ulist[0]['user'];
							$data['jtime'] = date('Y-m-d');
							$look['look'] = '2';
							// dump($data);

							if (M('sh')->where(['sid'=>['in',$ments]])->save($data) > 0) {
								if (M('look')->where(['id'=>['in',$ments]])->save($look) > 0) {
									echo '1111';
								}
							}
							break;

						case '6':  //董事办
							$data['dtype'] = $ulist[0]['m_type'];
							
							$data['dname'] = $ulist[0]['user'];
							$data['dtime'] = date('Y-m-d');
							$look['look'] = '6';
							// dump($data);

							if (M('sh')->where(['sid'=>['in',$ments]])->save($data) > 0) {
								if (M('look')->where(['id'=>['in',$ments]])->save($look) > 0) {
									echo '1111';
								}
							}
							break;
					}
				break;
			case '0':  //行政物资申购
					$data['wtype'] = '行政物品申购';
					switch ($ulist[0]['m_type']) {
						case '2':  //主管
							$data['ztype'] = $ulist[0]['m_type'];
							
							$data['zname'] = $ulist[0]['user'];
							$data['ztime'] = date('Y-m-d');
							$look['look'] = '1';
							// dump($data);
							// exit;

					        $c = [];
					        foreach ($ments as $k => $v) {
					            $c[$k]['sid'] = $v;
					            $c[$k]['ztype'] = $data['ztype'];
					            $c[$k]['zname'] = $data['zname'];
					            $c[$k]['ztime'] = $data['ztime'];
					            $c[$k]['stype'] = $data['stype'];
					        }
					        // dump($c);
					        // exit;

							if (M('sh')->addAll($c) > 0) {
								if (M('look')->where(['id'=>['in',$ments]])->save($look) > 0) {
									echo '1111';
								}
							}
							break;
						case '3':  //经理
							switch ($glist[0]['post']) {
								case '行政中心':
									$data['xtype'] = $ulist[0]['m_type'];
							
									$data['xname'] = $ulist[0]['user'];
									$data['xtime'] = date('Y-m-d');
									$look['look'] = '3';
									// dump($data);

									if (M('sh')->where(['sid'=>['in',$ments]])->save($data) > 0) {
										if (M('look')->where(['id'=>['in',$ments]])->save($look) > 0) {
											echo '1111';
										}
									}
									break;

								case '采购中心':
									$data['jtype'] = $ulist[0]['m_type'];
							
									$data['jname'] = $ulist[0]['user'];
									$data['jtime'] = date('Y-m-d');
									$look['look'] = '2';
									// dump($data);

									if (M('sh')->where(['sid'=>['in',$ments]])->save($data) > 0) {
										if (M('look')->where(['id'=>['in',$ments]])->save($look) > 0) {
											echo '1111';
										}
									}
									break;
								case '财务中心':
									$data['jtype'] = $ulist[0]['m_type'];
							
									$data['jname'] = $ulist[0]['user'];
									$data['jtime'] = date('Y-m-d');
									$look['look'] = '2';
									// dump($data);

									if (M('sh')->where(['sid'=>['in',$ments]])->save($data) > 0) {
										if (M('look')->where(['id'=>['in',$ments]])->save($look) > 0) {
											echo '1111';
										}
									}
									break;
								
							}
						
							break;



						case '4':  //行政
							$data['xtype'] = $ulist[0]['m_type'];
							
							$data['xname'] = $ulist[0]['user'];
							$data['xtime'] = date('Y-m-d');
							$look['look'] = '3';
							// dump($data);

							if (M('sh')->where(['sid'=>['in',$ments]])->save($data) > 0) {
								if (M('look')->where(['id'=>['in',$ments]])->save($look) > 0) {
									echo '1111';
								}
							}
							break;
						case '9':  //职能部门经理
							$data['jtype'] = $ulist[0]['m_type'];
							
							$data['jname'] = $ulist[0]['user'];
							$data['jtime'] = date('Y-m-d');
							$look['look'] = '2';
							// dump($data);

							if (M('sh')->where(['sid'=>['in',$ments]])->save($data) > 0) {
								if (M('look')->where(['id'=>['in',$ments]])->save($look) > 0) {
									echo '1111';
								}
							}
							break;
						case '8':  //网络中心经理
							$data['jtype'] = $ulist[0]['m_type'];
							
							$data['jname'] = $ulist[0]['user'];
							$data['jtime'] = date('Y-m-d');
							$look['look'] = '2';
							// dump($data);

							if (M('sh')->where(['sid'=>['in',$ments]])->save($data) > 0) {
								if (M('look')->where(['id'=>['in',$ments]])->save($look) > 0) {
									echo '1111';
								}
							}
							break;

						// case '6':  //董事办
						// 	$data['dtype'] = $ulist[0]['m_type'];
							
						// 	$data['dname'] = $ulist[0]['user'];
						// 	$data['dtime'] = date('Y-m-d');
						// 	$look['look'] = '5';
						// 	// dump($data);

						// 	if (M('sh')->where(['sid'=>['in',$ments]])->save($data) > 0) {
						// 		if (M('look')->where(['id'=>['in',$ments]])->save($look) > 0) {
						// 			echo '1111';
						// 		}
						// 	}
						// 	break;
					}
				break;




		}




		


        // dump($c);
        // exit;
		// dump($glist);
		// // if (M()) {
		// // 	# code...
		// // 
		
		

	}




	public function yue()
	{
		// dump($_GET);
		// $type = $_GET['type'];
		$gid = M('auth_group_access')->where(['uid'=>$_SESSION['uid']])->select();
		// dump($gid);
		// exit;
		$glist = M('auth_group')->where(['id'=>$gid[0]['group_id']])->select();
		// dump($glist);
		// exit;
		$ulist = M('member')->where(['uid'=>$_SESSION['uid']])->select();
		$apost = $glist[0]['post'];
			// echo $apost;
			// exit;
		// dump($type);
		// exit;
		// 
			if ($glist[0]['title'] == '超级管理员') {
							$db = M("look");
					        // $where = "a_id=".$uid;
					        $count = $db->where(['type'=>3])->count();
					        $pagecount = 10;
					        $page = new \Think\Page($count , $pagecount);
					        // $row[] = '';
					        $page->parameter = $row; //此处的row是数组，为了传递查询条件
					        $page->setConfig('first');
					        $page->setConfig('prev','上一页');
					        $page->setConfig('next','下一页');
					        $page->setConfig('last','尾页');
					        $page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% 第 '.I('p',1).' 页/共 %TOTAL_PAGE% 页 ( '.$pagecount.' 条/页 共 %TOTAL_ROW% 条)');
					        $show = $page->show();
					        $list = $db->where(['type'=>3])->order('id desc')->limit($page->firstRow.','.$page->listRows)->select();
					        $title = '部门月度申请审批';
					        $this->assign('list',$list);
					        $this->assign('page',$show);
					        $this->assign('title',$title);
							$this->display();
				exit;
			}

				switch ($ulist[0]['m_type']) {
					case '2':   //主管
							$db = M("look");
							// echo '111';
							// exit;
					        // $where = "a_id=".$uid;
					        $count = $db->where(['type'=>3,'look'=>0,'ment'=>$apost,'ju'=>0])->count();
					        // dump($apost);
					        // exit;
					        $pagecount = 9;
					        $page = new \Think\Page($count , $pagecount);
					        // $row[] = '';
					        $page->parameter = $row; //此处的row是数组，为了传递查询条件
					        $page->setConfig('first');
					        $page->setConfig('prev','上一页');
					        $page->setConfig('next','下一页');
					        $page->setConfig('last','尾页');
					        $page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% 第 '.I('p',1).' 页/共 %TOTAL_PAGE% 页 ( '.$pagecount.' 条/页 共 %TOTAL_ROW% 条)');
					        $show = $page->show();
					        $list = $db->where(['type'=>3,'look'=>0,'ment'=>$apost,'ju'=>0])->order('id desc')->limit($page->firstRow.','.$page->listRows)->select();
					        $title = '部门月度申请审批';
					        $this->assign('list',$list);
					        $this->assign('page',$show);
					        $this->assign('title',$title);
							$this->display();
						break;



					case '3':   //经理


							switch ($apost) {
								case '行政中心':
										$db = M("look");
										// echo '111';
										// exit;
								        // $where = "a_id=".$uid;
								        $count = $db->where(['look'=>8,'type'=>3,'ment'=>$apost,'ju'=>0])->count();
								        // dump($count);
								        // exit;
								        $pagecount = 9;
								        $page = new \Think\Page($count , $pagecount);
								        // $row[] = '';
								        $page->parameter = $row; //此处的row是数组，为了传递查询条件
								        $page->setConfig('first');
								        $page->setConfig('prev','上一页');
								        $page->setConfig('next','下一页');
								        $page->setConfig('last','尾页');
								        $page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% 第 '.I('p',1).' 页/共 %TOTAL_PAGE% 页 ( '.$pagecount.' 条/页 共 %TOTAL_ROW% 条)');
								        $show = $page->show();
								        $list = $db->where(['look'=>8,'type'=>3,'ment'=>$apost,'ju'=>0])->order('id desc')->limit($page->firstRow.','.$page->listRows)->select();
								        $title = '部门月度申请审批';


								        //---------------------------------------
								       
								    	$lei = 1;
								    	$cao = 1;//行政操作分类
								        $this->assign('list',$list);
								        $this->assign('lei',$lei);
								        $this->assign('cao',$cao);
								       
								        $this->assign('page',$show);
								        
								        $this->assign('title',$title);
										$this->display('Shenp/jyue');
									break;

								case '采购中心':
										$db = M("look");
										// echo '111';
										// exit;
								        // $where = "a_id=".$uid;
								        $count = $db->where(['look'=>9,'type'=>3,'ment'=>$apost,'ju'=>0])->count();
								        // dump($count);
								        // exit;
								        $pagecount = 9;
								        $page = new \Think\Page($count , $pagecount);
								        // $row[] = '';
								        $page->parameter = $row; //此处的row是数组，为了传递查询条件
								        $page->setConfig('first');
								        $page->setConfig('prev','上一页');
								        $page->setConfig('next','下一页');
								        $page->setConfig('last','尾页');
								        $page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% 第 '.I('p',1).' 页/共 %TOTAL_PAGE% 页 ( '.$pagecount.' 条/页 共 %TOTAL_ROW% 条)');
								        $show = $page->show();
								        $list = $db->where(['look'=>9,'type'=>3,'ment'=>$apost,'ju'=>0])->order('id desc')->limit($page->firstRow.','.$page->listRows)->select();
								        $title = '部门月度申请审批';


								        //---------------------------------------
								       
								    
								        $this->assign('list',$list);
								       
								        $this->assign('page',$show);
								        
								        $this->assign('title',$title);
										$this->display('Shenp/jyue');
									break;
								case '财务中心':
										$db = M("look");
										
								        $count = $db->where(['look'=>10,'type'=>3,'ment'=>$apost,'ju'=>0])->count();
								        // dump($count);
								        // exit;
								        $pagecount = 9;
								        $page = new \Think\Page($count , $pagecount);
								        $page->parameter = $row; //此处的row是数组，为了传递查询条件
								        $page->setConfig('first');
								        $page->setConfig('prev','上一页');
								        $page->setConfig('next','下一页');
								        $page->setConfig('last','尾页');
								        $page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% 第 '.I('p',1).' 页/共 %TOTAL_PAGE% 页 ( '.$pagecount.' 条/页 共 %TOTAL_ROW% 条)');
								        $show = $page->show();
								        $list = $db->where(['look'=>10,'type'=>3,'ment'=>$apost,'ju'=>0])->order('id desc')->limit($page->firstRow.','.$page->listRows)->select();
								        $title = '部门月度申请审批';


								        //---------------------------------------
								       
								    	$lei = 2;
								        $this->assign('list',$list);
								        $this->assign('lei',$lei);
								       
								        $this->assign('page',$show);
								        
								        $this->assign('title',$title);
										$this->display('Shenp/jyue');
									break;
								
								
							}





							
						break;
					case '4':  //行政
							$db = M("look");
					        // $where = "a_id=".$uid;
					        $count = $db->where(array('num'=>array('exp',' >number '),'type'=>3,'look'=>2,'ju'=>0))->count();
					        $pagecount = 9;
					        $page = new \Think\Page($count , $pagecount);
					        // $row[] = '';
					        $page->parameter = $row; //此处的row是数组，为了传递查询条件
					        $page->setConfig('first'); 
					        $page->setConfig('prev','上一页');
					        $page->setConfig('next','下一页');
					        $page->setConfig('last','尾页');
					        $page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% 第 '.I('p',1).' 页/共 %TOTAL_PAGE% 页 ( '.$pagecount.' 条/页 共 %TOTAL_ROW% 条)');
					        $show = $page->show();
					        $list = $db->where(array('num'=>array('exp',' >number '),'type'=>3,'look'=>2,'ju'=>0))->order('ment desc')->limit($page->firstRow.','.$page->listRows)->select();
					        $title = '部门月度申请审批';
					  //       $Model = M('look');//或者 $Model = D(); 或者 $Model = M();
							// $sql = "SELECT * FROM oa_look WHERE `num` > `number` AND `type` = 3 AND `look` = 2 AND `ju` = 0 ";
							// $voList = $Model->query($sql);
							// dump($list);
							// exit;
							$ylist = $db->where(array('num'=>array('exp',' >number '),'type'=>3,'look'=>2,'ju'=>0))->select();
							foreach ($ylist as  $v) {
								$coun += $v['zong']; 
							}
							$title = '无库存月度需求申请';
						

							
					        $lei = 1;
					        $dao = 3;
					       
							

					        $cao = 1;//行政操作分类
							$this->assign('cao',$cao);
					        $this->assign('list',$list);
					        $this->assign('coun',$coun);
					        $this->assign('dao',$dao);
					        $this->assign('lei',$lei);
					        $this->assign('page',$show);
					        $this->assign('title',$title);
							$this->display();
						break;

				

					case '5':  //财务
							$db = M("look");
					        // $where = "a_id=".$uid;
					        $count = $db->where(array('num'=>array('exp',' >number '),'type'=>3,'look'=>3,'ju'=>0))->count();
					        $pagecount = 10;
					        $page = new \Think\Page($count , $pagecount);
					        // $row[] = '';
					        $page->parameter = $row; //此处的row是数组，为了传递查询条件
					        $page->setConfig('first');
					        $page->setConfig('prev','上一页');
					        $page->setConfig('next','下一页');
					        $page->setConfig('last','尾页');
					        $page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% 第 '.I('p',1).' 页/共 %TOTAL_PAGE% 页 ( '.$pagecount.' 条/页 共 %TOTAL_ROW% 条)');
					        $show = $page->show();
					        $list = $db->where(array('num'=>array('exp',' >number '),'type'=>3,'look'=>3,'ju'=>0))->order('ment desc')->limit($page->firstRow.','.$page->listRows)->select();
					        $title = '公司月度需求审批';
					        $lei = 1;
					      	$ylist = $db->where(array('num'=>array('exp',' >number '),'type'=>3,'look'=>3,'ju'=>0))->select();
							foreach ($ylist as  $v) {
								$coun += $v['zong']; 
							}
							$this->assign('coun',$coun);
					        $this->assign('list',$list);
					        $this->assign('lei',$lei);
					        $this->assign('page',$show);
					        $this->assign('title',$title);
							$this->display();
						break;



					case '9':  //职能总经理
							$db = M("look");
							$mlist = M('auth_group')->where(['mtype'=>2])->select();

							foreach ($mlist as $vn) {
						
								$ments[] =  $vn['title'];
							

							}
							 $where = [
			            		'ment' => [
			                		'in',
			                		$ments
			            		],
			            		'look' => 1,
			            		'type'=>3,
			            		'ju'   => 0

			        		];

			        		$gwhere = [
			            		
			            		'look' => 4,
			            		'type'=>3,
			            		'ju'   => 0

			        		];
					        $count = $db->where($where)->count();
					        
					        $pagecount = 10;
					        $page = new \Think\Page($count , $pagecount);
					        // $row[] = '';
					        $page->parameter = $row; //此处的row是数组，为了传递查询条件
					        $page->setConfig('first');
					        $page->setConfig('prev','上一页');
					        $page->setConfig('next','下一页');
					        $page->setConfig('last','尾页');
					        $page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% 第 '.I('p',1).' 页/共 %TOTAL_PAGE% 页 ( '.$pagecount.' 条/页 共 %TOTAL_ROW% 条)');
					        $show = $page->show();
					        $list = $db->where($where)->order('ment desc')->limit($page->firstRow.','.$page->listRows)->select();
					        $title = '部门办公用品月度需求审批';
					        $lei = 3;//--------------------------------------------------------------------------------------------------------
					      	$gcount = $db->where($gwhere)->count();
					        
					        $gpagecount = 10;
					        $gpage = new \Think\Page($gcount , $gpagecount);
					        // $row[] = '';
					        $gpage->parameter = $row; //此处的row是数组，为了传递查询条件
					        $gpage->setConfig('first');
					        $gpage->setConfig('prev','上一页');
					        $gpage->setConfig('next','下一页');
					        $gpage->setConfig('last','尾页');
					        $gpage->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% 第 '.I('p',1).' 页/共 %TOTAL_PAGE% 页 ( '.$gpagecount.' 条/页 共 %TOTAL_ROW% 条)');
					        $gshow = $gpage->show();
					        $glist = $db->where($gwhere)->order('ment desc')->limit($gpage->firstRow.','.$gpage->listRows)->select();
					        $gtitle = '公司办公用品月度需求审批';
					        // echo $gtitle;
					        // exit;
					        $this->assign('list',$list);
					        $this->assign('glist',$glist);
					        $this->assign('lei',$lei);
					        $this->assign('page',$show);
					        $this->assign('gpage',$gshow);
					        $this->assign('title',$title);
					        $this->assign('gtitle',$gtitle);
							$this->display('Shenp/jyue');
						break;




					case '8':  //网络中心总经理
							$db = M("look");
							$mlist = M('auth_group')->where(['mtype'=>1])->select();

							foreach ($mlist as $vn) {
							// echo $v['n_id'];
							// exit;
							// $ment .= "`ment`="."'".$vn['title']."'"." or ";
							// $ment .= "'".$vn['title']."'"." , ";
								$ments[] =  $vn['title'];
								// 

							}
							 $where = [
			            		'ment' => [
			                		'in',
			                		$ments
			            		],
			            		'look' => 1,
			            		'type'=>3,
			            		'ju'   => 0

			        		];

			        		// dump($where);
			        		// exit;
					        // $where = "a_id=".$uid;
					        $count = $db->where($where)->count();
					        // dump($count);
					        // exit;
					        $pagecount = 10;
					        $page = new \Think\Page($count , $pagecount);
					        // $row[] = '';
					        $page->parameter = $row; //此处的row是数组，为了传递查询条件
					        $page->setConfig('first');
					        $page->setConfig('prev','上一页');
					        $page->setConfig('next','下一页');
					        $page->setConfig('last','尾页');
					        $page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% 第 '.I('p',1).' 页/共 %TOTAL_PAGE% 页 ( '.$pagecount.' 条/页 共 %TOTAL_ROW% 条)');
					        $show = $page->show();
					        $list = $db->where($where)->order('ment desc')->limit($page->firstRow.','.$page->listRows)->select();
					        $title = '部门月度申请审批';
					        // $lei = 1;
					        // $alist = M('look')->order('ment desc')->select();
					        // dump($alist);
					        // exit;
					        // $b = 0;
					        // foreach ($list as  $v) {
					        // 	$b += $v['']
					        // }
					        // field()
					        $this->assign('list',$list);
					        // $this->assign('lei',$lei);
					        $this->assign('page',$show);
					        $this->assign('title',$title);
							$this->display();
						break;


					case '6':  //董事办
							$db = M("look");
					        // $where = "a_id=".$uid;
					        $count = $db->where(['type'=>3,'look'=>5,'ju'=>0])->count();
					        $pagecount = 10;
					        $page = new \Think\Page($count , $pagecount);
					        // $row[] = '';
					        $page->parameter = $row; //此处的row是数组，为了传递查询条件
					        $page->setConfig('first');
					        $page->setConfig('prev','上一页');
					        $page->setConfig('next','下一页');
					        $page->setConfig('last','尾页');
					        $page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% 第 '.I('p',1).' 页/共 %TOTAL_PAGE% 页 ( '.$pagecount.' 条/页 共 %TOTAL_ROW% 条)');
					        $show = $page->show();
					        $list = $db->where(['type'=>3,'look'=>5,'ju'=>0])->order('ment desc')->limit($page->firstRow.','.$page->listRows)->select();
					        $title = '公司月度汇总审批';
					        $lei = 1;
					        // $alist = M('look')->order('ment desc')->select();
					        // dump($list);
					        // exit;
					        // $b = 0;
					        // foreach ($list as  $v) {
					        // 	$b += $v['']
					        // }
					        // field()
					        $ylist = $db->where(['type'=>3,'look'=>5,'ju'=>0])->select();
							foreach ($ylist as  $v) {
								$coun += $v['zong']; 
							}
							$this->assign('coun',$coun);
					        $this->assign('list',$list);
					        $this->assign('lei',$lei);
					        $this->assign('page',$show);
					        $this->assign('title',$title);
							$this->display();
						break;

					}

		// $this->display();
	}










	public function ysh()  //月度审核
	{
		

		$sid = $_POST['id'];
		// dump($sid);
		// exit;
		
		$ulist = M('member')->where(['uid'=>$_SESSION['uid']])->select();
		$gid = M('auth_group_access')->where(['uid'=>$_SESSION['uid']])->select();
		$glist = M('auth_group')->where(['id'=>$gid[0]['group_id']])->select();
		$apost = $glist[0]['post'];
		// dump($apost);
		// exit;
		$data['sid'] = $sid;
		$data['stype'] = '1';
		$ss = M('yue')->where(['sid'=>$sid])->select();
		// dump($ulist[0]['m_type']);
		// exit;
		switch ($ulist[0]['m_type']) {
			case '2': //主管
				
				$data['ztype'] = $ulist[0]['m_type'];
				$data['zname'] = $ulist[0]['user'];
				$data['ztime'] = date('Y-m-d');
				// dump($data);
				// exit;
				$look['look'] = '1';
				if (M('yue')->add($data) > 0) {
					if (M('look')->where(['id'=>$sid])->save($look) > 0) {
						echo '1111';
					}
				}
				break;
			case '9': //职能总经理
				$sss = M('yue')->where(['sid'=>$sid])->select();
				if (empty($sss[0]['cname'])) {
					$data['jtype'] = $ulist[0]['m_type'];
					$data['jname'] = $ulist[0]['user'];
					$data['jtime'] = date('Y-m-d');
					$look['look'] = '2';
				
						if (M('yue')->where(['sid'=>$sid])->save($data) > 0) {
							if (M('look')->where(['id'=>$sid])->save($look) > 0) {
								echo '1111';
							}
						}
				}else{
					$data['gtype'] = $ulist[0]['m_type'];
					$data['gname'] = $ulist[0]['user'];
					$data['gtime'] = date('Y-m-d');
					$look['look'] = '5';
				
						if (M('yue')->where(['sid'=>$sid])->save($data) > 0) {
							if (M('look')->where(['id'=>$sid])->save($look) > 0) {
								echo '1111';
							}
						}
				}
				
				
				break;
			case '8': //网络总经理
				
				$data['jtype'] = $ulist[0]['m_type'];
				$data['jname'] = $ulist[0]['user'];
				$data['jtime'] = date('Y-m-d');
				$look['look'] = '2';
			
					if (M('yue')->where(['sid'=>$sid])->save($data) > 0) {
						if (M('look')->where(['id'=>$sid])->save($look) > 0) {
							echo '1111';
						}
					}
				
				break;

			case '3': //经理
				switch ($apost) {
					case '行政中心':
					// echo '11';
					// exit;
							$data['jtype'] = $ulist[0]['m_type'];
							$data['jname'] = $ulist[0]['user'];
							$data['jtime'] = date('Y-m-d');
							$look['look'] = '2';
							// dump($data);
							// exit;
							
								if (M('yue')->where(['sid'=>$sid])->save($data) > 0) {
									if (M('look')->where(['id'=>$sid])->save($look) > 0) {
										echo '1111';
									}
								}
							
						break;
					case '采购中心':
							$data['jtype'] = $ulist[0]['m_type'];
							$data['jname'] = $ulist[0]['user'];
							$data['jtime'] = date('Y-m-d');
							$look['look'] = '2';
						
								if (M('yue')->where(['sid'=>$sid])->save($data) > 0) {
									if (M('look')->where(['id'=>$sid])->save($look) > 0) {
										echo '1111';
									}
								}
							
						break;
					case '财务中心':
							$data['jtype'] = $ulist[0]['m_type'];
							$data['jname'] = $ulist[0]['user'];
							$data['jtime'] = date('Y-m-d');
							$look['look'] = '2';
						
								if (M('yue')->where(['sid'=>$sid])->save($data) > 0) {
									if (M('look')->where(['id'=>$sid])->save($look) > 0) {
										echo '1111';
									}
								}
							
						break;
					
				}
			
				break;


			case '4': //行政

				$arr['xtype'] = $ulist[0]['m_type'];
				$arr['xname'] = $ulist[0]['user'];
				$arr['xtime'] = date('Y-m-d');
				$look['look'] = '3';
				if (M('yue')->where(['sid'=>$sid])->save($arr) > 0) {
					if (M('look')->where(['id'=>$sid])->save($look) > 0) {
						echo '1111';
					}
				}
				break;

			case '5': //财务
				$arr['ctype'] = $ulist[0]['m_type'];
				$arr['cname'] = $ulist[0]['user'];
				$arr['ctime'] = date('Y-m-d');
				$look['look'] = '4';
				if (M('yue')->where(['sid'=>$sid])->save($arr) > 0) {
					if (M('look')->where(['id'=>$sid])->save($look) > 0) {
						echo '1111';
					}
				}
				break;
			case '6': //董事办
				$arr['dtype'] = $ulist[0]['m_type'];
				$arr['dname'] = $ulist[0]['user'];
				$arr['dtime'] = date('Y-m-d');
				$look['look'] = '6';
				if (M('yue')->where(['sid'=>$sid])->save($arr) > 0) {
					if (M('look')->where(['id'=>$sid])->save($look) > 0) {
						echo '1111';
					}
				}
				break;

			

			
		}
		
	}











	public function yju()
	{
		
		$sid = $_POST['id'];
		
		
		$ulist = M('member')->where(['uid'=>$_SESSION['uid']])->select();
		$alist = M('auth_group_access')->where(['uid'=>$_SESSION['uid']])->select();
		$glist = M('auth_group')->where(['id'=>$alist[0]['group_id']])->select();
		
		$data['sid'] = $sid;
		$data['stype'] = '2';
		switch ($ulist[0]['m_type']) {
			case '2': //主管
				$data['ztype'] = $ulist[0]['m_type'];
				$data['zname'] = $ulist[0]['user'];
				$data['ztime'] = date('Y-m-d');
				$look['ju'] = '1';
				if (M('yue')->add($data) > 0) {
					if (M('look')->where(['id'=>$sid])->save($look) > 0) {
						echo '1111';
					}
				}
				break;
			case '3': //部门经理
				switch ($glist[0]['post']) {
					case '行政中心':
						$data['jtype'] = $ulist[0]['m_type'];
						$data['jname'] = $ulist[0]['user'];
						$data['jtime'] = date('Y-m-d');
						$look['ju'] = '2';
						if (M('yue')->where(['sid'=>$sid])->save($data) > 0) {
							if (M('look')->where(['id'=>$sid])->save($look) > 0) {
								echo '1111';
							}
						}
						break;
					case '采购中心':
						$data['jtype'] = $ulist[0]['m_type'];
						$data['jname'] = $ulist[0]['user'];
						$data['jtime'] = date('Y-m-d');
						$look['ju'] = '2';
						if (M('yue')->where(['sid'=>$sid])->save($data) > 0) {
							if (M('look')->where(['id'=>$sid])->save($look) > 0) {
								echo '1111';
							}
						}
						break;
					case '财务中心':
						$data['jtype'] = $ulist[0]['m_type'];
						$data['jname'] = $ulist[0]['user'];
						$data['jtime'] = date('Y-m-d');
						$look['ju'] = '2';
						if (M('yue')->where(['sid'=>$sid])->save($data) > 0) {
							if (M('look')->where(['id'=>$sid])->save($look) > 0) {
								echo '1111';
							}
						}
						break;
					
					
				}


				
				break;
			case '4': //行政
				$data['xtype'] = $ulist[0]['m_type'];
				$data['xname'] = $ulist[0]['user'];
				$data['xtime'] = date('Y-m-d');
				$look['ju'] = '3';
				if (M('yue')->where(['sid'=>$sid])->save($data) > 0) {
					if (M('look')->where(['id'=>$sid])->save($look) > 0) {
						echo '1111';
					}
				}
				break;
			case '9': //职能部门经理
				$slist = M('yue')->where(['sid'=>$sid])->select();

				if (empty($slist[0]['cname'])) {
					$data['jtype'] = $ulist[0]['m_type'];
					$data['jname'] = $ulist[0]['user'];
					$data['jtime'] = date('Y-m-d');
					$look['ju'] = '2';
					if (M('yue')->where(['sid'=>$sid])->save($data) > 0) {
						if (M('look')->where(['id'=>$sid])->save($look) > 0) {
							echo '1111';
						}
					}
				}else{
					$data['gtype'] = $ulist[0]['m_type'];
					$data['gname'] = $ulist[0]['user'];
					$data['gtime'] = date('Y-m-d');
					$look['ju'] = '6';
					if (M('yue')->where(['sid'=>$sid])->save($data) > 0) {
						if (M('look')->where(['id'=>$sid])->save($look) > 0) {
							echo '1111';
						}
					}

				}
				
				break;
			case '5': //财务
				$data['ctype'] = $ulist[0]['m_type'];
				$data['cname'] = $ulist[0]['user'];
				$data['ctime'] = date('Y-m-d');
				$look['ju'] = '4';
				if (M('yue')->where(['sid'=>$sid])->save($data) > 0) {
					if (M('look')->where(['id'=>$sid])->save($look) > 0) {
						echo '1111';
					}
				}
				break;
			case '6': //董事办
				$data['dtype'] = $ulist[0]['m_type'];
				$data['dname'] = $ulist[0]['user'];
				$data['dtime'] = date('Y-m-d');
				$look['ju'] = '5';
				if (M('yue')->where(['sid'=>$sid])->save($data) > 0) {
					if (M('look')->where(['id'=>$sid])->save($look) > 0) {
						echo '1111';
					}
				}
				break;

			}
		}



		public function ytong()
	{
		
		$llist = $_POST;
		// dump($llist);
		// exit;
		foreach ($llist as $k => $v) {
			// dump();
			// for ($i=0; $i <= $k ; $i++) { 
			// 	# code...
			// }
			$ment[]= $v;

			
		}
		$ments = $ment[0];
		// dump($ments);
		// exit;
		$data['stype'] = '1';

		$ulist = M('member')->where(['uid'=>$_SESSION['uid']])->select();
		$alist = M('auth_group_access')->where(['uid'=>$_SESSION['uid']])->select();
		$glist = M('auth_group')->where(['id'=>$alist[0]['group_id']])->select();
		$ss = M('yue')->where(['sid'=>['in',$ments]])->select();
		// dump($ss);
		// exit;
		switch ($ulist[0]['m_type']) {
			case '2':  //主管
				$data['ztype'] = $ulist[0]['m_type'];
				
				$data['zname'] = $ulist[0]['user'];
				$data['ztime'] = date('Y-m-d');
				$look['look'] = '1';
				// dump($data);
				// exit;

		        $c = [];
		        foreach ($ments as $k => $v) {
		            $c[$k]['sid'] = $v;
		            $c[$k]['ztype'] = $data['ztype'];
		            $c[$k]['zname'] = $data['zname'];
		            $c[$k]['ztime'] = $data['ztime'];
		            $c[$k]['stype'] = $data['stype'];
		        }
		        // dump($c);
		        // exit;

				if (M('yue')->addAll($c) > 0) {
					if (M('look')->where(['id'=>['in',$ments]])->save($look) > 0) {
						echo '1111';
					}
				}
				break;
			

			case '3':  //经理
				switch ($glist[0]['post']) {
					case '行政中心':
						$ylist = M('yue')->where(['sid'=>$ments[0]])->select();
						// dump($ylist);
						// exit;
						if (empty($ylist[0]['jname'])) {
							$data['jtype'] = $ulist[0]['m_type'];
				
							$data['jname'] = $ulist[0]['user'];
							$data['jtime'] = date('Y-m-d');
							$look['look'] = '2';
							// dump($data);
							// exit;
							if (M('yue')->where(['sid'=>['in',$ments]])->save($data) > 0) {
								if (M('look')->where(['id'=>['in',$ments]])->save($look) > 0) {
									echo '1111';
								}
							}
						}else{
							$data['xtype'] = $ulist[0]['m_type'];
				
							$data['xname'] = $ulist[0]['user'];
							$data['xtime'] = date('Y-m-d');
							$look['look'] = '3';
							if (M('yue')->where(['sid'=>['in',$ments]])->save($data) > 0) {
								if (M('look')->where(['id'=>['in',$ments]])->save($look) > 0) {
									echo '1111';
								}
							}
						}
						
						
						break;
					case '采购中心':
						$data['jtype'] = $ulist[0]['m_type'];
				
						$data['jname'] = $ulist[0]['user'];
						$data['jtime'] = date('Y-m-d');
						$look['look'] = '2';
						// dump($data);
						// exit;
						$c = [];
				        foreach ($ments as $k => $v) {
				            $c[$k]['sid'] = $v;
				            $c[$k]['jtype'] = $data['jtype'];
				            $c[$k]['jname'] = $data['jname'];
				            $c[$k]['jtime'] = $data['jtime'];
				            $c[$k]['stype'] = $data['stype'];
				        }
				     

					
							if (M('yue')->where(['sid'=>['in',$ments]])->save($data) > 0) {
								if (M('look')->where(['id'=>['in',$ments]])->save($look) > 0) {
									echo '1111';
								}
							}
						
						break;
					case '财务中心':
						$data['jtype'] = $ulist[0]['m_type'];
				
						$data['jname'] = $ulist[0]['user'];
						$data['jtime'] = date('Y-m-d');
						$look['look'] = '2';
						$c = [];
				        foreach ($ments as $k => $v) {
				            $c[$k]['sid'] = $v;
				            $c[$k]['jtype'] = $data['jtype'];
				            $c[$k]['jname'] = $data['jname'];
				            $c[$k]['jtime'] = $data['jtime'];
				            $c[$k]['stype'] = $data['stype'];
				        }

					
							if (M('yue')->where(['sid'=>['in',$ments]])->save($data) > 0) {
								if (M('look')->where(['id'=>['in',$ments]])->save($look) > 0) {
									echo '1111';
								}
							}
					
						break;
					
					
				}
				break;


			case '4':  //行政
				// $cha = M('look')->where(['id'=>['in',$ments]])->find();
				// dump($cha);
				// exit;
				$data['xtype'] = $ulist[0]['m_type'];
				
				$data['xname'] = $ulist[0]['user'];
				$data['xtime'] = date('Y-m-d');
				$look['look'] = '3';
				// dump($data);

				if (M('yue')->where(['sid'=>['in',$ments]])->save($data) > 0) {
					if (M('look')->where(['id'=>['in',$ments]])->save($look) > 0) {
						echo '1111';
					}
				}
				break;
			case '5':  //财务
				$data['ctype'] = $ulist[0]['m_type'];
				
				$data['cname'] = $ulist[0]['user'];
				$data['ctime'] = date('Y-m-d');
				$look['look'] = '4';
				// dump($data);

			

					if (M('yue')->where(['sid'=>['in',$ments]])->save($data) > 0) {
						if (M('look')->where(['id'=>['in',$ments]])->save($look) > 0) {
							echo '1111';
						}
					}
				
				break;



			case '9':  //职能总经理
				$yy = M('yue')->where(['sid'=>['in',$ments]])->find();
				// dump($yy);
				// exit;
				if (empty($yy['jname'])) {
					$data['jtype'] = $ulist[0]['m_type'];
					
					$data['jname'] = $ulist[0]['user'];
					$data['jtime'] = date('Y-m-d');
					$look['look'] = '2';
				
				
					if (M('yue')->where(['sid'=>['in',$ments]])->save($data) > 0) {
						if (M('look')->where(['id'=>['in',$ments]])->save($look) > 0) {
							echo '1111';
						}
					}
				}else{
					$data['gtype'] = $ulist[0]['m_type'];
					
					$data['gname'] = $ulist[0]['user'];
					$data['gtime'] = date('Y-m-d');
					$look['look'] = '5';
				
				
					if (M('yue')->where(['sid'=>['in',$ments]])->save($data) > 0) {
						if (M('look')->where(['id'=>['in',$ments]])->save($look) > 0) {
							echo '1111';
						}
					}
				}
				
				// if (M('yue')->where(['sid'=>['in',$ments]])->save($data) > 0) {
				// 	if (M('look')->where(['id'=>['in',$ments]])->save($look) > 0) {
				// 		echo '1111';
				// 	}
				// }
				break;
				
				
			case '8':  //网络总经理
				$data['jtype'] = $ulist[0]['m_type'];
				
				$data['jname'] = $ulist[0]['user'];
				$data['jtime'] = date('Y-m-d');
				$look['look'] = '2';
				
				// dump($data);

				
					if (M('yue')->where(['sid'=>['in',$ments]])->save($data) > 0) {
						if (M('look')->where(['id'=>['in',$ments]])->save($look) > 0) {
							echo '1111';
						}
					}
				
				// if (M('yue')->where(['sid'=>['in',$ments]])->save($data) > 0) {
				// 	if (M('look')->where(['id'=>['in',$ments]])->save($look) > 0) {
				// 		echo '1111';
				// 	}
				// }
				break;

			case '6':  //董事办
				$data['dtype'] = $ulist[0]['m_type'];
				
				$data['dname'] = $ulist[0]['user'];
				$data['dtime'] = date('Y-m-d');
				$look['look'] = '6';
				$c = [];
				foreach ($ments as $k => $v) {
				    $c[$k]['sid'] = $v;
				    $c[$k]['jtype'] = $data['jtype'];
				    $c[$k]['jname'] = $data['jname'];
				    $c[$k]['jtime'] = $data['jtime'];
				    $c[$k]['stype'] = $data['stype'];
				}
				// dump($data);
				
					if (M('yue')->where(['sid'=>['in',$ments]])->save($data) > 0) {
						if (M('look')->where(['id'=>['in',$ments]])->save($look) > 0) {
							echo '1111';
						}
					}
				
				break;

			
		}

	}
















	public function suoyou()
	{
										$db = M("look");
										// echo '111';
										// exit;
								        // $where = "a_id=".$uid;
								        $count = $db->where(array('num'=>array('exp',' >number '),'type'=>3,'look'=>2,'ju'=>0))->count();
								        // dump($count);
								        // exit;
								        $pagecount = 9;
								        $page = new \Think\Page($count , $pagecount);
								        // $row[] = '';
								        $page->parameter = $row; //此处的row是数组，为了传递查询条件
								        $page->setConfig('first');
								        $page->setConfig('prev','上一页');
								        $page->setConfig('next','下一页');
								        $page->setConfig('last','尾页');
								        $page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% 第 '.I('p',1).' 页/共 %TOTAL_PAGE% 页 ( '.$pagecount.' 条/页 共 %TOTAL_ROW% 条)');
								        $show = $page->show();
								        $list = $db->where(array('num'=>array('exp',' >number '),'type'=>3,'look'=>2,'ju'=>0))->order('ment desc')->limit($page->firstRow.','.$page->listRows)->select();
								        $title = '公司所有月度需求申请';
								        // dump($list);
								        // exit;

								        //---------------------------------------
								       	$ylist = $db->where(array('num'=>array('exp',' >number '),'type'=>3,'look'=>2,'ju'=>0))->select();
										foreach ($ylist as  $v) {
											$coun += $v['zong']; 
										}
								    
								        $this->assign('list',$list);
								        $this->assign('coun',$coun);
								       
								        $this->assign('page',$show);
								        
								        $this->assign('title',$title);
										// $this->display('Shenp/jyue');


										$this->display();
	}






	public function cai()
	{
										$db = M("look");
										// echo '111';
										// exit;
								        // $where = "a_id=".$uid;
								        $count = $db->where(array('num'=>array('exp',' >number '),'type'=>3,'look'=>3,'ju'=>0))->count();
								        // dump($count);
								        // exit;
								        $pagecount = 10;
								        $page = new \Think\Page($count , $pagecount);
								        // $row[] = '';
								        $page->parameter = $row; //此处的row是数组，为了传递查询条件
								        $page->setConfig('first');
								        $page->setConfig('prev','上一页');
								        $page->setConfig('next','下一页');
								        $page->setConfig('last','尾页');
								        $page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% 第 '.I('p',1).' 页/共 %TOTAL_PAGE% 页 ( '.$pagecount.' 条/页 共 %TOTAL_ROW% 条)');
								        $show = $page->show();
								        $list = $db->where(array('num'=>array('exp',' >number '),'type'=>3,'look'=>3,'ju'=>0))->order('ment desc')->limit($page->firstRow.','.$page->listRows)->select();
								        $title = '所有部门申请';
								       

								        //---------------------------------------
								       // $coun = M('look')->where(['type'=>3,'look'=>2,'ju'=>0])->sum('zong*100');
								       	$ylist = $db->where(array('num'=>array('exp',' >number '),'type'=>3,'look'=>3,'ju'=>0))->select();
										foreach ($ylist as  $v) {
											$coun += $v['zong']; 
										}

								       // echo $coun;
								       // exit;
								        // dump($list);
								        // exit;
										$this->assign('coun',$coun);
								    
								        $this->assign('list',$list);
								       
								        $this->assign('page',$show);
								        
								        $this->assign('title',$title);
										// $this->display('Shenp/jyue');


										$this->display();
	}





	public function gzong()
	{
										$db = M("look");
										// echo '111';
										// exit;
								        // $where = "a_id=".$uid;
								        $count = $db->where(['look'=>4,'type'=>3,'ju'=>0])->count();
								        // dump($count);
								        // exit;
								        $pagecount = 10;
								        $page = new \Think\Page($count , $pagecount);
								        // $row[] = '';
								        $page->parameter = $row; //此处的row是数组，为了传递查询条件
								        $page->setConfig('first');
								        $page->setConfig('prev','上一页');
								        $page->setConfig('next','下一页');
								        $page->setConfig('last','尾页');
								        $page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% 第 '.I('p',1).' 页/共 %TOTAL_PAGE% 页 ( '.$pagecount.' 条/页 共 %TOTAL_ROW% 条)');
								        $show = $page->show();
								        $list = $db->where(['look'=>4,'type'=>3,'ju'=>0])->order('ment desc')->limit($page->firstRow.','.$page->listRows)->select();
								        $title = '所有部门申请';
								        // dump($list);
								        // exit;

								        //---------------------------------------
								       
								    	$ylist = $db->where(['look'=>4,'type'=>3,'ju'=>0])->select();
										foreach ($ylist as  $v) {
											$coun += $v['zong']; 
										}
								        $this->assign('list',$list);
								       	$this->assign('coun',$coun);
								        $this->assign('page',$show);
								        
								        $this->assign('title',$title);
										// $this->display('Shenp/jyue');


										$this->display();
	}





	//行政查看全部通过的审批
	public function xlist()
	{
		$type = $_GET['type'];

		if (empty($type)) {
			
			$db = M("look");
										
			$xcount = $db->where(['look'=>3,'type'=>0,'ju'=>0])->count();
			$jcount = $db->where(['look'=>6,'type'=>1,'ju'=>0])->count();
			$gcount = $db->where(['look'=>6,'type'=>2,'ju'=>0])->count();
			// dump($xcount);
			// exit;
			$pagecount = 20;
			$page = new \Think\Page($gcount , $pagecount);
			// $row[] = '';
			$page->parameter = $row; //此处的row是数组，为了传递查询条件
			$page->setConfig('first');
			$page->setConfig('prev','上一页');
			$page->setConfig('next','下一页');
			$page->setConfig('last','尾页');
			$page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% 第 '.I('p',1).' 页/共 %TOTAL_PAGE% 页 ( '.$pagecount.' 条/页 共 %TOTAL_ROW% 条)');
			$show = $page->show();
			$list = $db->where(['look'=>3,'type'=>0,'ju'=>0])->order('ment desc')->limit($page->firstRow.','.$page->listRows)->select();
			$title = '已通过行政物资申请';
			$lei = '1';	
			$this->assign('lei',$lei);
			$this->assign('list',$list);
			$this->assign('xcount',$xcount);
			$this->assign('jcount',$jcount);
			$this->assign('gcount',$gcount);
			$this->assign('page',$show);
			$this->assign('title',$title);
			$this->display();

		}else{
			switch ($type) {
				case '1': //固定资产申购
					$db = M("look");
										
					$gcount = $db->where(['look'=>6,'type'=>2,'ju'=>0])->count();
					$jcount = $db->where(['look'=>6,'type'=>1,'ju'=>0])->count();
					$xcount = $db->where(['look'=>3,'type'=>0,'ju'=>0])->count();
					// dump($count);
					// exit;
					$pagecount = 10;
					$page = new \Think\Page($gcount , $pagecount);
					// $row[] = '';
					$page->parameter = $row; //此处的row是数组，为了传递查询条件
					$page->setConfig('first');
					$page->setConfig('prev','上一页');
					$page->setConfig('next','下一页');
					$page->setConfig('last','尾页');
					$page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% 第 '.I('p',1).' 页/共 %TOTAL_PAGE% 页 ( '.$pagecount.' 条/页 共 %TOTAL_ROW% 条)');
					$show = $page->show();
					$list = $db->where(['look'=>6,'type'=>2,'ju'=>0])->order('ment desc')->limit($page->firstRow.','.$page->listRows)->select();
					$title = '已通过固定资产申购';
					$lei = '2';	
					$this->assign('lei',$lei);
					$this->assign('list',$list);
					$this->assign('gcount',$gcount);
					$this->assign('xcount',$xcount);
					$this->assign('jcount',$jcount);
					$this->assign('page',$show);
					$this->assign('title',$title);
					$this->display();
					break;
				case '3': //急性物资申请
					$db = M("look");
										
					$jcount = $db->where(['look'=>6,'type'=>1,'ju'=>0])->count();
					$gcount = $db->where(['look'=>6,'type'=>2,'ju'=>0])->count();
					$xcount = $db->where(['look'=>3,'type'=>0,'ju'=>0])->count();
					// dump($jcount);
					// dump($gcount);
					// dump($xcount);
					// exit;
					$pagecount = 10;
					$page = new \Think\Page($jcount , $pagecount);
					// $row[] = '';
					$page->parameter = $row; //此处的row是数组，为了传递查询条件
					$page->setConfig('first');
					$page->setConfig('prev','上一页');
					$page->setConfig('next','下一页');
					$page->setConfig('last','尾页');
					$page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% 第 '.I('p',1).' 页/共 %TOTAL_PAGE% 页 ( '.$pagecount.' 条/页 共 %TOTAL_ROW% 条)');
					$show = $page->show();
					$list = $db->where(['look'=>6,'type'=>1,'ju'=>0])->order('ment desc')->limit($page->firstRow.','.$page->listRows)->select();
					$title = '已通过急性物资申请';
					$lei = '3';	
					$this->assign('lei',$lei);
					$this->assign('list',$list);
					$this->assign('gcount',$gcount);
					$this->assign('xcount',$xcount);
					$this->assign('jcount',$jcount);
					$this->assign('page',$show);
					$this->assign('title',$title);
					$this->display();
					break;
				
			}
		}


		
	}








	public function yzong()
	{	
		$db = M("look");
					        // $where = "a_id=".$uid;
		$count = $db->where(['type'=>3,'look'=>6,'ju'=>0])->count();
		$pagecount = 10;
		$page = new \Think\Page($count , $pagecount);
		// $row[] = '';
		$page->parameter = $row; //此处的row是数组，为了传递查询条件
		$page->setConfig('first');
		$page->setConfig('prev','上一页');
		$page->setConfig('next','下一页');
		$page->setConfig('last','尾页');
		$page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% 第 '.I('p',1).' 页/共 %TOTAL_PAGE% 页 ( '.$pagecount.' 条/页 共 %TOTAL_ROW% 条)');
		$show = $page->show();
		$list = $db->where(['type'=>3,'look'=>6,'ju'=>0])->order('ment desc')->limit($page->firstRow.','.$page->listRows)->select();
		$title = '所有已通过月度申请';
		// $lei = 1;
		// $dao = 3;
		$ylist = $db->where(['type'=>3,'look'=>6,'ju'=>0])->select();
		foreach ($ylist as  $v) {
			$coun += $v['zong']; 
		}
					   
					        
		$this->assign('list',$list);
		$this->assign('coun',$coun);
		// $this->assign('dao',$dao);
		// $this->assign('lei',$lei);
		$this->assign('page',$show);
		$this->assign('title',$title);
		$this->display();

	}


	public function yku()
	{	
		$db = M("look");
		// $where = "a_id=".$uid;
		$count = $db->where(array('number'=>array('exp',' >num '),'type'=>3,'look'=>3,'ju'=>0,))->count();
		$pagecount = 9;
		$page = new \Think\Page($count , $pagecount);
					        // $row[] = '';
		$page->parameter = $row; //此处的row是数组，为了传递查询条件
		$page->setConfig('first');
		$page->setConfig('prev','上一页');
		$page->setConfig('next','下一页');
		$page->setConfig('last','尾页');
		$page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% 第 '.I('p',1).' 页/共 %TOTAL_PAGE% 页 ( '.$pagecount.' 条/页 共 %TOTAL_ROW% 条)');
		$show = $page->show();
		$list = $db->where(array('number'=>array('exp',' >num '),'type'=>3,'look'=>3,'ju'=>0))->order('ment desc')->limit($page->firstRow.','.$page->listRows)->select();
		$title = '所有已通过月度申请';
		// $lei = 1;
		// $dao = 3;
		$ylist = $db->where(array('number'=>array('exp',' >num '),'type'=>3,'look'=>3,'ju'=>0))->select();
		foreach ($ylist as  $v) {
			$coun += $v['zong']; 
		}
					   
					        
		$this->assign('list',$list);
		$this->assign('coun',$coun);
		// $this->assign('dao',$dao);
		// $this->assign('lei',$lei);
		$this->assign('page',$show);
		$this->assign('title',$title);
		$this->display();

	}



	//月度审批一键拒绝
	public function yqju()
	{
		$llist = $_POST;
		// dump($llist);
		// exit;
		if (empty($llist['uids'])) {
			echo '3333';
			exit;
		}
		$arr[] = $llist['uids'];

		foreach ($arr as $k => $v) {
			// dump();
			// for ($i=0; $i <= $k ; $i++) { 
			// 	# code...
			// }
			// dump($v);
			$ment[]= $v;
			// $ment['cent']= $v['cent'];


			
		}
		$data['cent'] = $_POST['cent'];
		$ments = $ment[0];
		// dump($cent);
		// exit;
		$data['stype'] = '2';

		$ulist = M('member')->where(['uid'=>$_SESSION['uid']])->select();
		$alist = M('auth_group_access')->where(['uid'=>$_SESSION['uid']])->select();
		$glist = M('auth_group')->where(['id'=>$alist[0]['group_id']])->select();

		switch ($ulist[0]['m_type']) {
			case '3':  //经理
				switch ($glist[0]['post']) {
					case '行政中心':
						$data['xtype'] = $ulist[0]['m_type'];
						
						$data['xname'] = $ulist[0]['user'];
						$data['xtime'] = date('Y-m-d');
						$look['ju'] = '3';
										// dump($data);

						if (M('yue')->where(['sid'=>['in',$ments]])->save($data) > 0) {
							if (M('look')->where(['id'=>['in',$ments]])->save($look) > 0) {
								echo '1111';
							}
						}
						
						
						break;
					
					case '财务中心':
						$data['ctype'] = $ulist[0]['m_type'];
						
						$data['cname'] = $ulist[0]['user'];
						$data['ctime'] = date('Y-m-d');
						$look['ju'] = '4';
										// dump($data);

						if (M('yue')->where(['sid'=>['in',$ments]])->save($data) > 0) {
							if (M('look')->where(['id'=>['in',$ments]])->save($look) > 0) {
								echo '1111';
							}
						}
						break;
					
					
				}
				break;
			case '4':  //行政
				$data['xtype'] = $ulist[0]['m_type'];
						
				$data['xname'] = $ulist[0]['user'];
				$data['xtime'] = date('Y-m-d');
				$look['ju'] = '3';
								// dump($data);

				if (M('yue')->where(['sid'=>['in',$ments]])->save($data) > 0) {
					if (M('look')->where(['id'=>['in',$ments]])->save($look) > 0) {
						echo '1111';
					}
				}
				break;
			case '5':  //财务
				$data['ctype'] = $ulist[0]['m_type'];
						
				$data['cname'] = $ulist[0]['user'];
				$data['ctime'] = date('Y-m-d');
				$look['ju'] = '4';
								// dump($data);

				if (M('yue')->where(['sid'=>['in',$ments]])->save($data) > 0) {
					if (M('look')->where(['id'=>['in',$ments]])->save($look) > 0) {
						echo '1111';
					}
				}
				break;
			case '9':  //职能总经理
				$data['gtype'] = $ulist[0]['m_type'];
						
				$data['gname'] = $ulist[0]['user'];
				$data['gtime'] = date('Y-m-d');
				$look['ju'] = '5';
								// dump($data);

				if (M('yue')->where(['sid'=>['in',$ments]])->save($data) > 0) {
					if (M('look')->where(['id'=>['in',$ments]])->save($look) > 0) {
						echo '1111';
					}
				}
				break;
			case '6':  //职能总经理
				$data['dtype'] = $ulist[0]['m_type'];
						
				$data['dname'] = $ulist[0]['user'];
				$data['dtime'] = date('Y-m-d');
				$look['ju'] = '6';
								// dump($data);

				if (M('yue')->where(['sid'=>['in',$ments]])->save($data) > 0) {
					if (M('look')->where(['id'=>['in',$ments]])->save($look) > 0) {
						echo '1111';
					}
				}
				break;

				
		}



	}



	//月度审批单个拒绝
	
	function dju()
	{

		// dump(I());
		// exit;

		$ulist = M('member')->where(['uid'=>$_SESSION['uid']])->select();
		$alist = M('auth_group_access')->where(['uid'=>$_SESSION['uid']])->select();
		$glist = M('auth_group')->where(['id'=>$alist[0]['group_id']])->select();
		$llist = M('look')->where(['id'=>$_POST['id']])->find();
		$data['stype'] = '2';
		$data['cent'] = $_POST['cent'];
		// dump($llist);
		// exit;
		switch ($ulist[0]['m_type']) {
			case '2':  //主管
				$data['ztype'] = $ulist[0]['m_type'];
						
				$data['zname'] = $ulist[0]['user'];
				$data['ztime'] = date('Y-m-d');
				$data['sid'] = $_POST['id'];
				$data['cent'] = $_POST['cent'];
				// $data['stype'] = '2';
				$look['ju'] = '1';
								// dump($data);

				if (M('yue')->add($data) > 0) {
					if (M('look')->where(['id'=>$_POST['id']])->save($look) > 0) {
						echo '1111';
					}
				}
				break;
			case '3': //经理/总监
						switch ($glist[0]['post']) {
							case '行政中心':
								// $sid = $_POST['id'];	
								$ylist = M('yue')->where(['sid'=>$_POST['id']])->find();
								// dump($ylist);
								// exit;
								if (empty($ylist['jname'])) {
									$data['jtype'] = $ulist[0]['m_type'];
									$data['jname'] = $ulist[0]['user'];
									$data['jtime'] = date('Y-m-d');
									$look['ju'] = '2';
									if (M('yue')->where(['sid'=>$_POST['id']])->save($data) > 0) {
										if (M('look')->where(['id'=>$_POST['id']])->save($look) > 0) {
											echo '1111';
										}
									}
								}else{
									$data['xtype'] = $ulist[0]['m_type'];
									$data['xname'] = $ulist[0]['user'];
									$data['xtime'] = date('Y-m-d');
									$look['ju'] = '3';
									if (M('yue')->where(['sid'=>$_POST['id']])->save($data) > 0) {
										if (M('look')->where(['id'=>$_POST['id']])->save($look) > 0) {
											echo '1111';
										}
									}
								}
								
								break;
							case '采购中心':
								$data['jtype'] = $ulist[0]['m_type'];
								$data['jname'] = $ulist[0]['user'];
								$data['jtime'] = date('Y-m-d');
								$look['ju'] = '2';
								if (M('yue')->where(['sid'=>$_POST['id']])->save($data) > 0) {
									if (M('look')->where(['id'=>$_POST['id']])->save($look) > 0) {
										echo '1111';
									}
								}
								break;
							case '财务中心':
									$ylist = M('yue')->where(['sid'=>$_POST['id']])->find();
									if (empty($ylist['jname'])) {
										$data['jtype'] = $ulist[0]['m_type'];
										$data['jname'] = $ulist[0]['user'];
										$data['jtime'] = date('Y-m-d');
										$look['ju'] = '2';
										if (M('yue')->where(['sid'=>$_POST['id']])->save($data) > 0) {
											if (M('look')->where(['id'=>$_POST['id']])->save($look) > 0) {
												echo '1111';
											}
										}
									}else{
										$data['ctype'] = $ulist[0]['m_type'];
										$data['cname'] = $ulist[0]['user'];
										$data['ctime'] = date('Y-m-d');
										$look['ju'] = '4';
										if (M('yue')->where(['sid'=>$_POST['id']])->save($data) > 0) {
											if (M('look')->where(['id'=>$_POST['id']])->save($look) > 0) {
												echo '1111';
											}
										}
									}
									
								
								break;
							
						}

						break;
			
			
			case '9':  //职能总经理
				$ylist = M('yue')->where(['sid'=>$_POST['id']])->find();
				// dump($_POST['id']);
				// exit;
				if (empty($ylist['jname'])) {
					$data['jtype'] = $ulist[0]['m_type'];
					$data['jname'] = $ulist[0]['user'];
					$data['jtime'] = date('Y-m-d');
					$look['ju'] = '2';
									// dump($data);

					if (M('yue')->where(['sid'=>$_POST['id']])->save($data) > 0) {
						if (M('look')->where(['id'=>$_POST['id']])->save($look) > 0) {
							echo '1111';
						}
					}
				}else{
					$data['gtype'] = $ulist[0]['m_type'];
					$data['gname'] = $ulist[0]['user'];
					$data['gtime'] = date('Y-m-d');
					$look['ju'] = '5';
									// dump($data);

					if (M('yue')->where(['sid'=>$_POST['id']])->save($data) > 0) {
						if (M('look')->where(['id'=>$_POST['id']])->save($look) > 0) {
							echo '1111';
						}
					}
				}
				
				break;
			

				
		}
	}










	function xiu() //行政修改单价与数量
	{
		// dump(I());
		// exit;
		$id = $_POST['id'];
		$data = $_POST;
		$data['zong'] = $_POST['num'] * $_POST['unit'];
		$ce = M('look')->where(['id'=>$id])->find();
		// dump($ce);
		// exit;
		if ($_POST['unit'] == $ce['unit'] && $_POST['num'] == $ce['num']) {
			echo '3';
			exit;
			// exit;
		}
		

		if (M('look')->where(['id'=>$id])->save($data) > 0) {
			$llist = M('look')->where(['look'=>2,'type'=>3,'ju'=>0])->select();
			 foreach ($llist as  $v) {
				$coun += $v['zong']; 
			}
			
				// $coun['dan'] = $data['zong'];
			$this->ajaxReturn($coun);
		}else{
			$arr = 2;
			$this->ajaxReturn($arr);
		}



	}






	//月度申请审批展示库存已有物资
	public function ku()
	{	
		$ulist = M('member')->where(['uid'=>$_SESSION['uid']])->select();
		// dump($ulist);
		// exit;
		switch ($ulist[0]['m_type']) {
			case '4'://行政主管
				// $arr = M('look')->where('num','<','number')->select();
							$db = M("look");
					        // $where = "a_id=".$uid;
					        $count = $db->where(array('number'=>array('exp',' >=num '),'type'=>3,'look'=>2,'ju'=>0))->count();
					        $pagecount = 9;
					        $page = new \Think\Page($count , $pagecount);
					        // $row[] = '';
					        $page->parameter = $row; //此处的row是数组，为了传递查询条件
					        $page->setConfig('first');
					        $page->setConfig('prev','上一页');
					        $page->setConfig('next','下一页');
					        $page->setConfig('last','尾页');
					        $page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% 第 '.I('p',1).' 页/共 %TOTAL_PAGE% 页 ( '.$pagecount.' 条/页 共 %TOTAL_ROW% 条)');
					        $show = $page->show();
					        $list = $db->where(array('number'=>array('exp',' >=num '),'type'=>3,'look'=>2,'ju'=>0))->order('ment desc')->limit($page->firstRow.','.$page->listRows)->select();
							// dump($list);
							// exit;
						$ylist = $db->where(array('number'=>array('exp',' >=num '),'type'=>3,'look'=>2,'ju'=>0))->select();
						foreach ($ylist as  $v) {
							$coun += $v['zong']; 
						}
				$lei = 1;
				$title = '库存已有月度申请';
				$this->assign('coun',$coun);
				$this->assign('lei',$lei);
				$this->assign('title',$title);
				$this->assign('list',$list);
				$this->assign('page',$show);

				$this->display();
				break;
			case '3'://行政经理
				// $arr = M('look')->where('num','<','number')->select();
				$db = M("look");
					        // $where = "a_id=".$uid;
					        $count = $db->where(array('number'=>array('exp',' >=num '),'type'=>3,'look'=>2,'ju'=>0))->count();
					        $pagecount = 10;
					        $page = new \Think\Page($count , $pagecount);
					        // $row[] = '';
					        $page->parameter = $row; //此处的row是数组，为了传递查询条件
					        $page->setConfig('first');
					        $page->setConfig('prev','上一页');
					        $page->setConfig('next','下一页');
					        $page->setConfig('last','尾页');
					        $page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% 第 '.I('p',1).' 页/共 %TOTAL_PAGE% 页 ( '.$pagecount.' 条/页 共 %TOTAL_ROW% 条)');
					        $show = $page->show();
					        $list = $db->where(array('number'=>array('exp',' >=num '),'type'=>3,'look'=>2,'ju'=>0))->order('ment desc')->limit($page->firstRow.','.$page->listRows)->select();
							// dump($list);
							// exit;
				$ylist = $db->where(array('number'=>array('exp',' >=num '),'type'=>3,'look'=>2,'ju'=>0))->select();
						foreach ($ylist as  $v) {
							$coun += $v['zong']; 
						}
				$title = '库存已有月度申请';
				$lei = 2;
				$this->assign('lei',$lei);
				$this->assign('coun',$coun);
				$this->assign('title',$title);
				$this->assign('list',$list);
				$this->assign('page',$show);

				$this->display();
				break;
			
		}
		
						
	}



	//展示派车申请列表
	public function che()
	{

		$gid = M('auth_group_access')->where(['uid'=>$_SESSION['uid']])->select();
		// dump($gid);
		// exit;
		$glist = M('auth_group')->where(['id'=>$gid[0]['group_id']])->select();  //权限
		// dump($type);
		// exit;
		$ulist = M('member')->where(['uid'=>$_SESSION['uid']])->select();  //用户
		$apost = $glist[0]['post'];


		switch ($ulist[0]['m_type']) {
			case '2': //主管
				// echo '111';
				// exit;
				$db = M("turn");
				$count = $db->where(['type'=>1,'look'=>0,'ju'=>0])->count();
				$pagecount = 8;
				$page = new \Think\Page($count , $pagecount);
				// $row[] = '';
				$page->parameter = $row; //此处的row是数组，为了传递查询条件
				$page->setConfig('first');
				$page->setConfig('prev','上一页');
				$page->setConfig('next','下一页');
				$page->setConfig('last','尾页');
				$page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% 第 '.I('p',1).' 页/共 %TOTAL_PAGE% 页 ( '.$pagecount.' 条/页 共 %TOTAL_ROW% 条)');
				$show = $page->show();
				$list = $db->where(['type'=>1,'look'=>0,'ju'=>0])->order('id desc')->limit($page->firstRow.','.$page->listRows)->select();
				$title = '部门市内派车申请';
				// dump($list);
				// exit;
				$this->assign('list',$list);
				$this->assign('page',$show);
				$this->assign('title',$title);
				$this->display();
				break;
			case '3': //经理
				switch ($apost) {
								case '行政中心':
										$db = M("turn");
										// echo '111';
										// exit;
								        // $where = "a_id=".$uid;
								        $count = $db->where(['look'=>2,'type'=>1,'ju'=>0])->count();
								        // dump($count);
								        // exit;
								        $pagecount = 10;
								        $page = new \Think\Page($count , $pagecount);
								        // $row[] = '';
								        $page->parameter = $row; //此处的row是数组，为了传递查询条件
								        $page->setConfig('first');
								        $page->setConfig('prev','上一页');
								        $page->setConfig('next','下一页');
								        $page->setConfig('last','尾页');
								        $page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% 第 '.I('p',1).' 页/共 %TOTAL_PAGE% 页 ( '.$pagecount.' 条/页 共 %TOTAL_ROW% 条)');
								        $show = $page->show();
								        $list = $db->where(['look'=>2,'type'=>1,'ju'=>0])->order('id desc')->limit($page->firstRow.','.$page->listRows)->select();
								        $title = '公司市内派车申请';
								        $xing = 1;

								        //---------------------------------------
								       
					
								        $this->assign('list',$list);
								        $this->assign('lei',$lei);
								        $this->assign('xing',$xing);
								       
								        $this->assign('page',$show);
								        
								        $this->assign('title',$title);
										$this->display();
									break;

								case '采购中心':
										$db = M("turn");
										// echo '111';
										// exit;
								        // $where = "a_id=".$uid;
								        $count = $db->where(['look'=>9,'type'=>1,'ment'=>$apost,'ju'=>0])->count();
								        // dump($count);
								        // exit;
								        $pagecount = 10;
								        $page = new \Think\Page($count , $pagecount);
								        // $row[] = '';
								        $page->parameter = $row; //此处的row是数组，为了传递查询条件
								        $page->setConfig('first');
								        $page->setConfig('prev','上一页');
								        $page->setConfig('next','下一页');
								        $page->setConfig('last','尾页');
								        $page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% 第 '.I('p',1).' 页/共 %TOTAL_PAGE% 页 ( '.$pagecount.' 条/页 共 %TOTAL_ROW% 条)');
								        $show = $page->show();
								        $list = $db->where(['look'=>9,'type'=>1,'ment'=>$apost,'ju'=>0])->order('id desc')->limit($page->firstRow.','.$page->listRows)->select();
								        $title = '部门市内派车申请';


								        //---------------------------------------
								       
								    
								        $this->assign('list',$list);
								       
								        $this->assign('page',$show);
								        
								        $this->assign('title',$title);
										$this->display('Shenp/jyue');
									break;
								case '财务中心':
										$db = M("turn");
										
								        $count = $db->where(['look'=>10,'type'=>1,'ment'=>$apost,'ju'=>0])->count();
								        // dump($count);
								        // exit;
								        $pagecount = 10;
								        $page = new \Think\Page($count , $pagecount);
								        $page->parameter = $row; //此处的row是数组，为了传递查询条件
								        $page->setConfig('first');
								        $page->setConfig('prev','上一页');
								        $page->setConfig('next','下一页');
								        $page->setConfig('last','尾页');
								        $page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% 第 '.I('p',1).' 页/共 %TOTAL_PAGE% 页 ( '.$pagecount.' 条/页 共 %TOTAL_ROW% 条)');
								        $show = $page->show();
								        $list = $db->where(['look'=>10,'type'=>1,'ment'=>$apost,'ju'=>0])->order('id desc')->limit($page->firstRow.','.$page->listRows)->select();
								        $title = '部门市内派车申请';


								        //---------------------------------------
						
								        $this->assign('list',$list);
								        $this->assign('lei',$lei);
								       
								        $this->assign('page',$show);
								        
								        $this->assign('title',$title);
										$this->display('Shenp/jyue');
									break;
								
								
							}
				break;
			case '4': //行政
				
				$db = M("turn");
				$count = $db->where(['type'=>1,'look'=>2,'ju'=>0])->count();
				$pagecount = 8;
				$page = new \Think\Page($count , $pagecount);
				// $row[] = '';
				$page->parameter = $row; //此处的row是数组，为了传递查询条件
				$page->setConfig('first');
				$page->setConfig('prev','上一页');
				$page->setConfig('next','下一页');
				$page->setConfig('last','尾页');
				$page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% 第 '.I('p',1).' 页/共 %TOTAL_PAGE% 页 ( '.$pagecount.' 条/页 共 %TOTAL_ROW% 条)');
				$show = $page->show();
				$list = $db->where(['type'=>1,'look'=>2,'ju'=>0])->order('id desc')->limit($page->firstRow.','.$page->listRows)->select();
				$title = '公司市内派车申请';
				// dump($list);
				// exit;
				$this->assign('list',$list);
				$this->assign('page',$show);
				$this->assign('title',$title);
				$this->display();
				break;
			case '9':  //职能总经理
							$db = M("turn");
							$mlist = M('auth_group')->where(['mtype'=>2])->select();

							foreach ($mlist as $vn) {
						
								$ments[] =  $vn['title'];
							

							}
							 $where = [
			            		'ment' => [
			                		'in',
			                		$ments
			            		],
			            		'look' => 1,
			            		'type'=>1,
			            		'ju'   => 0

			        		];

			        	
					        $count = $db->where($where)->count();
					        
					        $pagecount = 10;
					        $page = new \Think\Page($count , $pagecount);
					        // $row[] = '';
					        $page->parameter = $row; //此处的row是数组，为了传递查询条件
					        $page->setConfig('first');
					        $page->setConfig('prev','上一页');
					        $page->setConfig('next','下一页');
					        $page->setConfig('last','尾页');
					        $page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% 第 '.I('p',1).' 页/共 %TOTAL_PAGE% 页 ( '.$pagecount.' 条/页 共 %TOTAL_ROW% 条)');
					        $show = $page->show();
					        $list = $db->where($where)->order('ment desc')->limit($page->firstRow.','.$page->listRows)->select();
					        $title = '部门市内派车申请';
					        // dump($list);
					        // exit;
					      
					        $this->assign('list',$list);
					        $this->assign('lei',$lei);
					        $this->assign('page',$show);
					        $this->assign('title',$title);
							$this->display('Shenp/che');
						break;




					case '8':  //网络中心总经理
							$db = M("turn");
							$mlist = M('auth_group')->where(['mtype'=>1])->select();

							foreach ($mlist as $vn) {
							// echo $v['n_id'];
							// exit;
							// $ment .= "`ment`="."'".$vn['title']."'"." or ";
							// $ment .= "'".$vn['title']."'"." , ";
								$ments[] =  $vn['title'];
								// 

							}
							 $where = [
			            		'ment' => [
			                		'in',
			                		$ments
			            		],
			            		'look' => 1,
			            		'type'=>1,
			            		'ju'   => 0

			        		];

			        		// dump($where);
			        		// exit;
					        // $where = "a_id=".$uid;
					        $count = $db->where($where)->count();
					        // dump($count);
					        // exit;
					        $pagecount = 10;
					        $page = new \Think\Page($count , $pagecount);
					        // $row[] = '';
					        $page->parameter = $row; //此处的row是数组，为了传递查询条件
					        $page->setConfig('first');
					        $page->setConfig('prev','上一页');
					        $page->setConfig('next','下一页');
					        $page->setConfig('last','尾页');
					        $page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% 第 '.I('p',1).' 页/共 %TOTAL_PAGE% 页 ( '.$pagecount.' 条/页 共 %TOTAL_ROW% 条)');
					        $show = $page->show();
					        $list = $db->where($where)->order('ment desc')->limit($page->firstRow.','.$page->listRows)->select();
					        $title = '部门市内派车申请';
					       
					        $this->assign('list',$list);
					        // $this->assign('lei',$lei);
					        $this->assign('page',$show);
					        $this->assign('title',$title);
							$this->display();
						break;


					case '6':  //董事办
							$db = M("turn");
					        // $where = "a_id=".$uid;
					        $count = $db->where(['type'=>2,'look'=>3,'ju'=>0])->count();
					        $pagecount = 10;
					        $page = new \Think\Page($count , $pagecount);
					        // $row[] = '';
					        $page->parameter = $row; //此处的row是数组，为了传递查询条件
					        $page->setConfig('first');
					        $page->setConfig('prev','上一页');
					        $page->setConfig('next','下一页');
					        $page->setConfig('last','尾页');
					        $page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% 第 '.I('p',1).' 页/共 %TOTAL_PAGE% 页 ( '.$pagecount.' 条/页 共 %TOTAL_ROW% 条)');
					        $show = $page->show();
					        $list = $db->where(['type'=>2,'look'=>3,'ju'=>0])->order('ment desc')->limit($page->firstRow.','.$page->listRows)->select();
					        $title = '公司市外派车申请';
					        $lei = 1;
					       
							$this->assign('coun',$coun);
					        $this->assign('list',$list);
					        $this->assign('lei',$lei);
					        $this->assign('page',$show);
					        $this->assign('title',$title);
							$this->display();
						break;
		}



	}




	//单个派车申请通过
	public function csh()
	{
		
		$sid = $_POST['id'];
		
		$ulist = M('member')->where(['uid'=>$_SESSION['uid']])->select();
		$gid = M('auth_group_access')->where(['uid'=>$_SESSION['uid']])->select();
		$glist = M('auth_group')->where(['id'=>$gid[0]['group_id']])->select();
		$apost = $glist[0]['post'];
		// dump($apost);
		// exit;
		$data['sid'] = $sid;
		$data['stype'] = '1';
		if ($_POST['lei'] == 1) {
			$data['type'] = '1';
		}else{
			$data['type'] = '2';
		}
		// $ss = M('yue')->where(['sid'=>$sid])->select();
		// dump($ulist[0]['m_type']);
		// exit;
		switch ($ulist[0]['m_type']) {
			case '2': //主管
				$data['ztype'] = $ulist[0]['m_type'];
				$data['zname'] = $ulist[0]['user'];
				$data['ztime'] = date('Y-m-d');
				// dump($data);
				// exit;
				$look['look'] = '1';
				if (M('che')->add($data) > 0) {
					if (M('turn')->where(['id'=>$sid])->save($look) > 0) {
						echo '1111';
					}
				}
				break;
			case '3': //经理
				switch ($apost) {
					case '行政中心':
							$clist = M('che')->where(['sid'=>$sid])->find();
							if (empty($clist['jname'])) {
								$data['jtype'] = $ulist[0]['m_type'];
								$data['jname'] = $ulist[0]['user'];
								$data['jtime'] = date('Y-m-d');
								$look['look'] = '2';
								// dump($data);
								// exit;
								
									if (M('che')->where(['sid'=>$sid])->save($data) > 0) {
										if (M('turn')->where(['id'=>$sid])->save($look) > 0) {
											echo '1111';
										}
									}
							}else{
								$data['xtype'] = $ulist[0]['m_type'];
								$data['xname'] = $ulist[0]['user'];
								$data['xtime'] = date('Y-m-d');
								$look['look'] = '3';
								// dump($data);
								// exit;
								
									if (M('che')->where(['sid'=>$sid])->save($data) > 0) {
										if (M('turn')->where(['id'=>$sid])->save($look) > 0) {
											echo '1111';
										}
									}
							}
							
							
						break;
					case '采购中心':
							$data['jtype'] = $ulist[0]['m_type'];
							$data['jname'] = $ulist[0]['user'];
							$data['jtime'] = date('Y-m-d');
							$look['look'] = '2';
						
								if (M('che')->where(['sid'=>$sid])->save($data) > 0) {
									if (M('turn')->where(['id'=>$sid])->save($look) > 0) {
										echo '1111';
									}
								}
							
						break;
					case '财务中心':
							$data['jtype'] = $ulist[0]['m_type'];
							$data['jname'] = $ulist[0]['user'];
							$data['jtime'] = date('Y-m-d');
							$look['look'] = '2';
						
								if (M('che')->where(['sid'=>$sid])->save($data) > 0) {
									if (M('turn')->where(['id'=>$sid])->save($look) > 0) {
										echo '1111';
									}
								}
							
						break;
					
				}
				break;
			case '4': //行政
				
				$data['xtype'] = $ulist[0]['m_type'];
				$data['xname'] = $ulist[0]['user'];
				$data['xtime'] = date('Y-m-d');
				// dump($data);
				// exit;
				$look['look'] = '3';
				if (M('che')->where(['sid'=>$sid])->save($data) > 0) {
					if (M('turn')->where(['id'=>$sid])->save($look) > 0) {
						echo '1111';
					}
				}
				break;
			case '6': //董事办
				
				$data['dtype'] = $ulist[0]['m_type'];
				$data['dname'] = $ulist[0]['user'];
				$data['dtime'] = date('Y-m-d');
				// dump($data);
				// exit;
				$look['look'] = '4';
				if (M('che')->where(['sid'=>$sid])->save($data) > 0) {
					if (M('turn')->where(['id'=>$sid])->save($look) > 0) {
						echo '1111';
					}
				}
				break;
			case '9': //职能总经理
				$data['jtype'] = $ulist[0]['m_type'];
				$data['jname'] = $ulist[0]['user'];
				$data['jtime'] = date('Y-m-d');
				// dump($data);
				// exit;
				$look['look'] = '2';
				if (M('che')->where(['sid'=>$sid])->save($data) > 0) {
					if (M('turn')->where(['id'=>$sid])->save($look) > 0) {
						echo '1111';
					}
				}
				
				
				break;
			case '8': //网络总经理
				
				$data['jtype'] = $ulist[0]['m_type'];
				$data['jname'] = $ulist[0]['user'];
				$data['jtime'] = date('Y-m-d');
				$look['look'] = '2';
			
				if (M('che')->where(['sid'=>$sid])->save($data) > 0) {
					if (M('turn')->where(['id'=>$sid])->save($look) > 0) {
						echo '1111';
					}
				}
				
				break;

		}




	}



	//单个派车申请拒绝
	public function cju()
	{
		$sid = $_POST['id'];
		
		
		$ulist = M('member')->where(['uid'=>$_SESSION['uid']])->select();
		$alist = M('auth_group_access')->where(['uid'=>$_SESSION['uid']])->select();
		$glist = M('auth_group')->where(['id'=>$alist[0]['group_id']])->select();
		
		$data['sid'] = $sid;
		$data['stype'] = '2';
		if ($_POST['lei'] == 1) {
			$data['type'] = '1';
		}else{
			$data['type'] = '2';
		}
		switch ($ulist[0]['m_type']) {
			case '2': //主管
				$data['ztype'] = $ulist[0]['m_type'];
				$data['zname'] = $ulist[0]['user'];
				$data['ztime'] = date('Y-m-d');
				$look['ju'] = '1';
				// dump($data);
				// exit;
				if (M('che')->add($data) > 0) {
					if (M('turn')->where(['id'=>$sid])->save($look) > 0) {
						echo '1111';
					}
				}
				break;
			case '3': //部门经理
				switch ($glist[0]['post']) {
					case '行政中心':
						$clist = M('che')->where(['sid'=>$sid])->find();
						if (empty($clist[''])) {
							
						}
						$data['jtype'] = $ulist[0]['m_type'];
						$data['jname'] = $ulist[0]['user'];
						$data['jtime'] = date('Y-m-d');
						$look['ju'] = '2';
						if (M('che')->where(['sid'=>$sid])->save($data) > 0) {
							if (M('turn')->where(['id'=>$sid])->save($look) > 0) {
								echo '1111';
							}
						}
						break;
					case '采购中心':
						$data['jtype'] = $ulist[0]['m_type'];
						$data['jname'] = $ulist[0]['user'];
						$data['jtime'] = date('Y-m-d');
						$look['ju'] = '2';
						if (M('che')->where(['sid'=>$sid])->save($data) > 0) {
							if (M('turn')->where(['id'=>$sid])->save($look) > 0) {
								echo '1111';
							}
						}
						break;
					case '财务中心':
						$data['jtype'] = $ulist[0]['m_type'];
						$data['jname'] = $ulist[0]['user'];
						$data['jtime'] = date('Y-m-d');
						$look['ju'] = '2';
						if (M('che')->where(['sid'=>$sid])->save($data) > 0) {
							if (M('turn')->where(['id'=>$sid])->save($look) > 0) {
								echo '1111';
							}
						}
						break;
					
					
				}


				
				break;
			case '4': //行政
				// echo '111';
				// exit;
				$data['xtype'] = $ulist[0]['m_type'];
				$data['xname'] = $ulist[0]['user'];
				$data['xtime'] = date('Y-m-d');
				$look['ju'] = '3';
				if (M('che')->where(['sid'=>$sid])->save($data) > 0) {
					if (M('turn')->where(['id'=>$sid])->save($look) > 0) {
						echo '1111';
					}
				}
				break;
			case '9': //职能部门经理
			

				
					$data['jtype'] = $ulist[0]['m_type'];
					$data['jname'] = $ulist[0]['user'];
					$data['jtime'] = date('Y-m-d');
					$look['ju'] = '2';
					if (M('che')->where(['sid'=>$sid])->save($data) > 0) {
						if (M('turn')->where(['id'=>$sid])->save($look) > 0) {
							echo '1111';
						}
					}
				
				
				break;
			
			case '6': //董事办
				$data['dtype'] = $ulist[0]['m_type'];
				$data['dname'] = $ulist[0]['user'];
				$data['dtime'] = date('Y-m-d');
				$look['ju'] = '4';
				if (M('che')->where(['sid'=>$sid])->save($data) > 0) {
					if (M('turn')->where(['id'=>$sid])->save($look) > 0) {
						echo '1111';
					}
				}
				break;

			}
	}



	//派车申请一键通过
	public function ctong()
	{
		$llist = $_POST;
		foreach ($llist as $k => $v) {
			// dump();
			// for ($i=0; $i <= $k ; $i++) { 
			// 	# code...
			// }
			$ment[]= $v;

			
		}
		$ments = $ment[0];
		$data['stype'] = '1';
	
			$data['type'] = '1';
	

		$ulist = M('member')->where(['uid'=>$_SESSION['uid']])->select();
		$alist = M('auth_group_access')->where(['uid'=>$_SESSION['uid']])->select();
		$glist = M('auth_group')->where(['id'=>$alist[0]['group_id']])->select();
		$ss = M('yue')->where(['sid'=>['in',$ments]])->select();
		// dump($ss);
		// exit;
		switch ($ulist[0]['m_type']) {
			case '2':  //主管
				$data['ztype'] = $ulist[0]['m_type'];
				
				$data['zname'] = $ulist[0]['user'];
				$data['ztime'] = date('Y-m-d');
				$look['look'] = '1';
				// dump($data);
				// exit;

		        $c = [];
		        foreach ($ments as $k => $v) {
		            $c[$k]['sid'] = $v;
		            $c[$k]['ztype'] = $data['ztype'];
		            $c[$k]['zname'] = $data['zname'];
		            $c[$k]['ztime'] = $data['ztime'];
		            $c[$k]['stype'] = $data['stype'];
		            $c[$k]['type'] = $data['type'];
		        }
		        // dump($c);
		        // exit;

				if (M('che')->addAll($c) > 0) {
					if (M('turn')->where(['id'=>['in',$ments]])->save($look) > 0) {
						echo '1111';
					}
				}
				break;
			

			case '3':  //经理
				switch ($glist[0]['post']) {
					case '行政中心':

						$data['xtype'] = $ulist[0]['m_type'];
				
						$data['xname'] = $ulist[0]['user'];
						$data['xtime'] = date('Y-m-d');
						$look['look'] = '3';
						// dump($data);
						// exit;
					
							if (M('che')->where(['sid'=>['in',$ments]])->save($data) > 0) {
								if (M('turn')->where(['id'=>['in',$ments]])->save($look) > 0) {
									echo '1111';
								}
							}
						
						break;
					case '采购中心':
						$data['jtype'] = $ulist[0]['m_type'];
				
						$data['jname'] = $ulist[0]['user'];
						$data['jtime'] = date('Y-m-d');
						$look['look'] = '2';
						// dump($data);
						// exit;
					

					
							if (M('che')->where(['sid'=>['in',$ments]])->save($data) > 0) {
								if (M('turn')->where(['id'=>['in',$ments]])->save($look) > 0) {
									echo '1111';
								}
							}
						
						break;
					case '财务中心':
						$data['jtype'] = $ulist[0]['m_type'];
				
						$data['jname'] = $ulist[0]['user'];
						$data['jtime'] = date('Y-m-d');
						$look['look'] = '2';
					

					
							if (M('che')->where(['sid'=>['in',$ments]])->save($data) > 0) {
								if (M('turn')->where(['id'=>['in',$ments]])->save($look) > 0) {
									echo '1111';
								}
							}
					
						break;
					
					
				}
				break;


			case '4':  //行政
				// $cha = M('look')->where(['id'=>['in',$ments]])->find();
				// dump($cha);
				// exit;
				$data['xtype'] = $ulist[0]['m_type'];
				
				$data['xname'] = $ulist[0]['user'];
				$data['xtime'] = date('Y-m-d');
				$look['look'] = '3';
				// dump($data);

				if (M('che')->where(['sid'=>['in',$ments]])->save($data) > 0) {
					if (M('turn')->where(['id'=>['in',$ments]])->save($look) > 0) {
						echo '1111';
					}
				}
				break;
			


			case '9':  //职能总经理
				$data['jtype'] = $ulist[0]['m_type'];
				
				$data['jname'] = $ulist[0]['user'];
				$data['jtime'] = date('Y-m-d');
				$look['look'] = '2';
			
				
					if (M('che')->where(['sid'=>['in',$ments]])->save($data) > 0) {
						if (M('turn')->where(['id'=>['in',$ments]])->save($look) > 0) {
							echo '1111';
						}
					}
				
			
				break;
			case '8':  //网络总经理
				$data['jtype'] = $ulist[0]['m_type'];
				
				$data['jname'] = $ulist[0]['user'];
				$data['jtime'] = date('Y-m-d');
				$look['look'] = '2';
				
				// dump($data);

				
					if (M('che')->where(['sid'=>['in',$ments]])->save($data) > 0) {
						if (M('turn')->where(['id'=>['in',$ments]])->save($look) > 0) {
							echo '1111';
						}
					}
				
				// if (M('yue')->where(['sid'=>['in',$ments]])->save($data) > 0) {
				// 	if (M('look')->where(['id'=>['in',$ments]])->save($look) > 0) {
				// 		echo '1111';
				// 	}
				// }
				break;

			case '6':  //董事办
				$data['dtype'] = $ulist[0]['m_type'];
				
				$data['dname'] = $ulist[0]['user'];
				$data['dtime'] = date('Y-m-d');
				$look['look'] = '4';
				
				
					if (M('che')->where(['sid'=>['in',$ments]])->save($data) > 0) {
						if (M('turn')->where(['id'=>['in',$ments]])->save($look) > 0) {
							echo '1111';
						}
					}
				
				break;

			
		}
	}

	//市外派车申请一键通过
	public function cwtong()
	{
		$llist = $_POST;
		foreach ($llist as $k => $v) {
			// dump();
			// for ($i=0; $i <= $k ; $i++) { 
			// 	# code...
			// }
			$ment[]= $v;

			
		}
		$ments = $ment[0];
		$data['stype'] = '1';
		
			$data['type'] = '2';
		

		$ulist = M('member')->where(['uid'=>$_SESSION['uid']])->select();
		$alist = M('auth_group_access')->where(['uid'=>$_SESSION['uid']])->select();
		$glist = M('auth_group')->where(['id'=>$alist[0]['group_id']])->select();
		$ss = M('yue')->where(['sid'=>['in',$ments]])->select();
		// dump($ss);
		// exit;
		switch ($ulist[0]['m_type']) {
			case '2':  //主管
				$data['ztype'] = $ulist[0]['m_type'];
				
				$data['zname'] = $ulist[0]['user'];
				$data['ztime'] = date('Y-m-d');
				$look['look'] = '1';
				// dump($data);
				// exit;

		        $c = [];
		        foreach ($ments as $k => $v) {
		            $c[$k]['sid'] = $v;
		            $c[$k]['ztype'] = $data['ztype'];
		            $c[$k]['zname'] = $data['zname'];
		            $c[$k]['ztime'] = $data['ztime'];
		            $c[$k]['stype'] = $data['stype'];
		            $c[$k]['type'] = $data['type'];
		        }
		        // dump($c);
		        // exit;

				if (M('che')->addAll($c) > 0) {
					if (M('turn')->where(['id'=>['in',$ments]])->save($look) > 0) {
						echo '1111';
					}
				}
				break;
			

			case '3':  //经理
				switch ($glist[0]['post']) {
					case '行政中心':

						$data['xtype'] = $ulist[0]['m_type'];
				
						$data['xname'] = $ulist[0]['user'];
						$data['xtime'] = date('Y-m-d');
						$look['look'] = '3';
						// dump($data);
						// exit;
					
							if (M('che')->where(['sid'=>['in',$ments]])->save($data) > 0) {
								if (M('turn')->where(['id'=>['in',$ments]])->save($look) > 0) {
									echo '1111';
								}
							}
						
						break;
					case '采购中心':
						$data['jtype'] = $ulist[0]['m_type'];
				
						$data['jname'] = $ulist[0]['user'];
						$data['jtime'] = date('Y-m-d');
						$look['look'] = '2';
						// dump($data);
						// exit;
					

					
							if (M('che')->where(['sid'=>['in',$ments]])->save($data) > 0) {
								if (M('turn')->where(['id'=>['in',$ments]])->save($look) > 0) {
									echo '1111';
								}
							}
						
						break;
					case '财务中心':
						$data['jtype'] = $ulist[0]['m_type'];
				
						$data['jname'] = $ulist[0]['user'];
						$data['jtime'] = date('Y-m-d');
						$look['look'] = '2';
					

					
							if (M('che')->where(['sid'=>['in',$ments]])->save($data) > 0) {
								if (M('turn')->where(['id'=>['in',$ments]])->save($look) > 0) {
									echo '1111';
								}
							}
					
						break;
					
					
				}
				break;


			case '4':  //行政
				// $cha = M('look')->where(['id'=>['in',$ments]])->find();
				// dump($cha);
				// exit;
				$data['xtype'] = $ulist[0]['m_type'];
				
				$data['xname'] = $ulist[0]['user'];
				$data['xtime'] = date('Y-m-d');
				$look['look'] = '3';
				// dump($data);

				if (M('che')->where(['sid'=>['in',$ments]])->save($data) > 0) {
					if (M('turn')->where(['id'=>['in',$ments]])->save($look) > 0) {
						echo '1111';
					}
				}
				break;
			


			case '9':  //职能总经理
				$data['jtype'] = $ulist[0]['m_type'];
				
				$data['jname'] = $ulist[0]['user'];
				$data['jtime'] = date('Y-m-d');
				$look['look'] = '2';
			
				
					if (M('che')->where(['sid'=>['in',$ments]])->save($data) > 0) {
						if (M('turn')->where(['id'=>['in',$ments]])->save($look) > 0) {
							echo '1111';
						}
					}
				
			
				break;
			case '8':  //网络总经理
				$data['jtype'] = $ulist[0]['m_type'];
				
				$data['jname'] = $ulist[0]['user'];
				$data['jtime'] = date('Y-m-d');
				$look['look'] = '2';
				
				// dump($data);

				
					if (M('che')->where(['sid'=>['in',$ments]])->save($data) > 0) {
						if (M('turn')->where(['id'=>['in',$ments]])->save($look) > 0) {
							echo '1111';
						}
					}
				
				// if (M('yue')->where(['sid'=>['in',$ments]])->save($data) > 0) {
				// 	if (M('look')->where(['id'=>['in',$ments]])->save($look) > 0) {
				// 		echo '1111';
				// 	}
				// }
				break;

			case '6':  //董事办
				$data['dtype'] = $ulist[0]['m_type'];
				
				$data['dname'] = $ulist[0]['user'];
				$data['dtime'] = date('Y-m-d');
				$look['look'] = '4';
				
				
					if (M('che')->where(['sid'=>['in',$ments]])->save($data) > 0) {
						if (M('turn')->where(['id'=>['in',$ments]])->save($look) > 0) {
							echo '1111';
						}
					}
				
				break;

			
		}
	}





	//展示市外派车申请列表
	public function chew()
	{

		$gid = M('auth_group_access')->where(['uid'=>$_SESSION['uid']])->select();
		// dump($gid);
		// exit;
		$glist = M('auth_group')->where(['id'=>$gid[0]['group_id']])->select();  //权限
		// dump($type);
		// exit;
		$ulist = M('member')->where(['uid'=>$_SESSION['uid']])->select();  //用户
		$apost = $glist[0]['post'];


		switch ($ulist[0]['m_type']) {
			case '2': //主管
				// echo '111';
				// exit;
				$db = M("turn");
				$count = $db->where(['type'=>2,'look'=>0,'ju'=>0])->count();
				$pagecount = 8;
				$page = new \Think\Page($count , $pagecount);
				// $row[] = '';
				$page->parameter = $row; //此处的row是数组，为了传递查询条件
				$page->setConfig('first');
				$page->setConfig('prev','上一页');
				$page->setConfig('next','下一页');
				$page->setConfig('last','尾页');
				$page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% 第 '.I('p',1).' 页/共 %TOTAL_PAGE% 页 ( '.$pagecount.' 条/页 共 %TOTAL_ROW% 条)');
				$show = $page->show();
				$list = $db->where(['type'=>2,'look'=>0,'ju'=>0])->order('id desc')->limit($page->firstRow.','.$page->listRows)->select();
				$title = '部门市外派车申请';
				// dump($list);
				// exit;
				$this->assign('list',$list);
				$this->assign('page',$show);
				$this->assign('title',$title);
				$this->display();
				break;
			case '3': //经理
				switch ($apost) {
								case '行政中心':
										$db = M("turn");
										// echo '111';
										// exit;
								        // $where = "a_id=".$uid;
								        $count = $db->where(['look'=>2,'type'=>2,'ju'=>0])->count();
								        // dump($count);
								        // exit;
								        $pagecount = 10;
								        $page = new \Think\Page($count , $pagecount);
								        // $row[] = '';
								        $page->parameter = $row; //此处的row是数组，为了传递查询条件
								        $page->setConfig('first');
								        $page->setConfig('prev','上一页');
								        $page->setConfig('next','下一页');
								        $page->setConfig('last','尾页');
								        $page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% 第 '.I('p',1).' 页/共 %TOTAL_PAGE% 页 ( '.$pagecount.' 条/页 共 %TOTAL_ROW% 条)');
								        $show = $page->show();
								        $list = $db->where(['look'=>2,'type'=>2,'ju'=>0])->order('id desc')->limit($page->firstRow.','.$page->listRows)->select();
								        $title = '公司市外派车申请';


								        //---------------------------------------
								       	$xing = 1;
					
								        $this->assign('list',$list);
								        $this->assign('xing',$xing);
								        $this->assign('cao',$cao);
								       
								        $this->assign('page',$show);
								        
								        $this->assign('title',$title);
										$this->display();
									break;

								case '采购中心':
										$db = M("turn");
										// echo '111';
										// exit;
								        // $where = "a_id=".$uid;
								        $count = $db->where(['look'=>9,'type'=>2,'ment'=>$apost,'ju'=>0])->count();
								        // dump($count);
								        // exit;
								        $pagecount = 10;
								        $page = new \Think\Page($count , $pagecount);
								        // $row[] = '';
								        $page->parameter = $row; //此处的row是数组，为了传递查询条件
								        $page->setConfig('first');
								        $page->setConfig('prev','上一页');
								        $page->setConfig('next','下一页');
								        $page->setConfig('last','尾页');
								        $page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% 第 '.I('p',1).' 页/共 %TOTAL_PAGE% 页 ( '.$pagecount.' 条/页 共 %TOTAL_ROW% 条)');
								        $show = $page->show();
								        $list = $db->where(['look'=>9,'type'=>2,'ment'=>$apost,'ju'=>0])->order('id desc')->limit($page->firstRow.','.$page->listRows)->select();
								        $title = '部门市外派车申请';


								        //---------------------------------------
								       
								    
								        $this->assign('list',$list);
								       
								        $this->assign('page',$show);
								        
								        $this->assign('title',$title);
										$this->display('Shenp/jyue');
									break;
								case '财务中心':
										$db = M("turn");
										
								        $count = $db->where(['look'=>10,'type'=>2,'ment'=>$apost,'ju'=>0])->count();
								        // dump($count);
								        // exit;
								        $pagecount = 10;
								        $page = new \Think\Page($count , $pagecount);
								        $page->parameter = $row; //此处的row是数组，为了传递查询条件
								        $page->setConfig('first');
								        $page->setConfig('prev','上一页');
								        $page->setConfig('next','下一页');
								        $page->setConfig('last','尾页');
								        $page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% 第 '.I('p',1).' 页/共 %TOTAL_PAGE% 页 ( '.$pagecount.' 条/页 共 %TOTAL_ROW% 条)');
								        $show = $page->show();
								        $list = $db->where(['look'=>10,'type'=>2,'ment'=>$apost,'ju'=>0])->order('id desc')->limit($page->firstRow.','.$page->listRows)->select();
								        $title = '部门市外派车申请';


								        //---------------------------------------
						
								        $this->assign('list',$list);
								        $this->assign('lei',$lei);
								       
								        $this->assign('page',$show);
								        
								        $this->assign('title',$title);
										$this->display('Shenp/jyue');
									break;
								
								
							}
				break;
			case '4': //行政
				
				$db = M("turn");
				$count = $db->where(['type'=>2,'look'=>2,'ju'=>0])->count();
				$pagecount = 8;
				$page = new \Think\Page($count , $pagecount);
				// $row[] = '';
				$page->parameter = $row; //此处的row是数组，为了传递查询条件
				$page->setConfig('first');
				$page->setConfig('prev','上一页');
				$page->setConfig('next','下一页');
				$page->setConfig('last','尾页');
				$page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% 第 '.I('p',1).' 页/共 %TOTAL_PAGE% 页 ( '.$pagecount.' 条/页 共 %TOTAL_ROW% 条)');
				$show = $page->show();
				$list = $db->where(['type'=>2,'look'=>2,'ju'=>0])->order('id desc')->limit($page->firstRow.','.$page->listRows)->select();
				$title = '公司市外派车申请';
				// dump($list);
				// exit;
				$this->assign('list',$list);
				$this->assign('page',$show);
				$this->assign('title',$title);
				$this->display();
				break;
			case '9':  //职能总经理
							$db = M("turn");
							$mlist = M('auth_group')->where(['mtype'=>2])->select();

							foreach ($mlist as $vn) {
						
								$ments[] =  $vn['title'];
							

							}
							 $where = [
			            		'ment' => [
			                		'in',
			                		$ments
			            		],
			            		'look' => 1,
			            		'type'=>2,
			            		'ju'   => 0

			        		];

			        	
					        $count = $db->where($where)->count();
					        
					        $pagecount = 10;
					        $page = new \Think\Page($count , $pagecount);
					        // $row[] = '';
					        $page->parameter = $row; //此处的row是数组，为了传递查询条件
					        $page->setConfig('first');
					        $page->setConfig('prev','上一页');
					        $page->setConfig('next','下一页');
					        $page->setConfig('last','尾页');
					        $page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% 第 '.I('p',1).' 页/共 %TOTAL_PAGE% 页 ( '.$pagecount.' 条/页 共 %TOTAL_ROW% 条)');
					        $show = $page->show();
					        $list = $db->where($where)->order('ment desc')->limit($page->firstRow.','.$page->listRows)->select();
					        $title = '部门市外派车申请';
					        // dump($list);
					        // exit;
					      
					        $this->assign('list',$list);
					        $this->assign('lei',$lei);
					        $this->assign('page',$show);
					        $this->assign('title',$title);
							$this->display();
						break;




					case '8':  //网络中心总经理
							$db = M("turn");
							$mlist = M('auth_group')->where(['mtype'=>1])->select();

							foreach ($mlist as $vn) {
							// echo $v['n_id'];
							// exit;
							// $ment .= "`ment`="."'".$vn['title']."'"." or ";
							// $ment .= "'".$vn['title']."'"." , ";
								$ments[] =  $vn['title'];
								// 

							}
							 $where = [
			            		'ment' => [
			                		'in',
			                		$ments
			            		],
			            		'look' => 1,
			            		'type'=>2,
			            		'ju'   => 0

			        		];

			        		// dump($where);
			        		// exit;
					        // $where = "a_id=".$uid;
					        $count = $db->where($where)->count();
					        // dump($count);
					        // exit;
					        $pagecount = 10;
					        $page = new \Think\Page($count , $pagecount);
					        // $row[] = '';
					        $page->parameter = $row; //此处的row是数组，为了传递查询条件
					        $page->setConfig('first');
					        $page->setConfig('prev','上一页');
					        $page->setConfig('next','下一页');
					        $page->setConfig('last','尾页');
					        $page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% 第 '.I('p',1).' 页/共 %TOTAL_PAGE% 页 ( '.$pagecount.' 条/页 共 %TOTAL_ROW% 条)');
					        $show = $page->show();
					        $list = $db->where($where)->order('ment desc')->limit($page->firstRow.','.$page->listRows)->select();
					        $title = '部门市外派车申请';
					       
					        $this->assign('list',$list);
					        // $this->assign('lei',$lei);
					        $this->assign('page',$show);
					        $this->assign('title',$title);
							$this->display();
						break;


					case '6':  //董事办
							$db = M("look");
					        // $where = "a_id=".$uid;
					        $count = $db->where(['type'=>2,'look'=>4,'ju'=>0])->count();
					        $pagecount = 10;
					        $page = new \Think\Page($count , $pagecount);
					        // $row[] = '';
					        $page->parameter = $row; //此处的row是数组，为了传递查询条件
					        $page->setConfig('first');
					        $page->setConfig('prev','上一页');
					        $page->setConfig('next','下一页');
					        $page->setConfig('last','尾页');
					        $page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% 第 '.I('p',1).' 页/共 %TOTAL_PAGE% 页 ( '.$pagecount.' 条/页 共 %TOTAL_ROW% 条)');
					        $show = $page->show();
					        $list = $db->where(['type'=>2,'look'=>4,'ju'=>0])->order('ment desc')->limit($page->firstRow.','.$page->listRows)->select();
					        $title = '公司市外派车申请';
					        $lei = 1;
					       
							$this->assign('coun',$coun);
					        $this->assign('list',$list);
					        $this->assign('lei',$lei);
					        $this->assign('page',$show);
					        $this->assign('title',$title);
							$this->display();
						break;
		}



	}



























}   //END